pub struct AgentHandler { /* private fields */ }
Expand description
This struct has all the functions an agent can use when communicating with its trustee or other agents
Implementations§
source§impl AgentHandler
impl AgentHandler
pub fn new( name: String, agent_id: MeshId, agent_trustee_id: MeshId, listener_enclave_id: Option<MeshId>, listener_subsystem: Option<MeshSubsystem>, requests: RequestTable, routing_table: RoutingTable, ) -> AgentHandler
pub fn is_bootstrapped(&self) -> bool
pub fn create_and_link_entity_on_same_agent( &self, source_emid: MeshEntityKeychainMeshId, entity_type: Option<MeshEntityType>, data_operations: Option<Vec<DataOperation>>, expiration_time: Option<i64>, link_updates_source: Option<AgentMeshLinkUpdates>, link_updates_destination: Option<AgentMeshLinkUpdates>, reply_callback: ReplyCallback<LinkEntityOnSameAgentResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub async fn async_create_and_link_entity_on_same_agent( &self, source_emid: MeshEntityKeychainMeshId, entity_type: Option<MeshEntityType>, data_operations: Option<Vec<DataOperation>>, expiration_time: Option<i64>, link_updates_source: Option<AgentMeshLinkUpdates>, link_updates_destination: Option<AgentMeshLinkUpdates>, context_id: Option<ContextId>, ) -> Result<LinkEntityOnSameAgentResult, MeshError>
pub fn link_entity_on_same_agent( &self, source_emid: MeshEntityKeychainMeshId, link_code: MeshLinkCode, link_updates_source: Option<AgentMeshLinkUpdates>, link_updates_destination: Option<AgentMeshLinkUpdates>, reply_callback: ReplyCallback<LinkEntityOnSameAgentResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn lookup_entity_on_same_agent( &self, source_emid: MeshEntityKeychainMeshId, lemid: LinkedEntityKeychainMeshId, reply_callback: ReplyCallback<LookupEntityOnSameAgentResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn create_entity( &self, emid: Option<MeshEntityKeychainMeshId>, entity_type: Option<MeshEntityType>, data_operations: Option<Vec<DataOperation>>, expiration_time: Option<i64>, reply_callback: ReplyCallback<CreateEntityResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub async fn async_create_entity( &self, emid: Option<MeshEntityKeychainMeshId>, entity_type: Option<MeshEntityType>, data_operations: Option<Vec<DataOperation>>, expiration_time: Option<i64>, context_id: Option<ContextId>, ) -> Result<CreateEntityResult, MeshError>
pub fn mutate_emid_data( &self, emid: MeshEntityKeychainMeshId, key_path: Vec<Vec<u8>>, mutate_callback: Box<dyn Fn(&mut DataEntry) -> Result<Option<MutateCallbackResultData>, MeshError> + Send + Sync>, reply_callback: Box<dyn FnOnce(Result<MutateReplyData, MeshError>) -> Result<Vec<MeshMessage>, MeshError> + Send + Sync>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn mutate_lemid_data( &self, emid: MeshEntityKeychainMeshId, lemid: LinkedEntityKeychainMeshId, key_path: Vec<Vec<u8>>, mutate_callback: Box<dyn Fn(&mut DataEntry) -> Result<Option<MutateCallbackResultData>, MeshError> + Send + Sync>, reply_callback: Box<dyn FnOnce(Result<MutateReplyData, MeshError>) -> Result<Vec<MeshMessage>, MeshError> + Send + Sync>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn data_operation_for_entity( &self, operations: Vec<AgentDataOperationForEntityInput>, reply_callback: ReplyCallback<DataOperationForEntityResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub async fn async_data_operation_for_entity( &self, operations: Vec<AgentDataOperationForEntityInput>, context_id: Option<ContextId>, ) -> Result<DataOperationForEntityResult, MeshError>
pub async fn async_link_entity( &self, destination_agent_id: MeshId, emid: MeshEntityKeychainMeshId, destination_link_id: LinkRequestId, request_message: Option<WrappedMessage>, link_updates: Option<AgentMeshLinkUpdates>, context_id: Option<ContextId>, ) -> Result<LinkEntityResult, MeshError>
pub async fn async_link_entity_with_transform_error_option( &self, destination_agent_id: MeshId, emid: MeshEntityKeychainMeshId, destination_link_id: LinkRequestId, request_message: Option<WrappedMessage>, link_updates: Option<AgentMeshLinkUpdates>, transform_error: bool, context_id: Option<ContextId>, ) -> Result<LinkEntityResult, MeshError>
pub fn link_entity( &self, destination_agent_id: MeshId, emid: MeshEntityKeychainMeshId, destination_link_id: LinkRequestId, request_message: Option<WrappedMessage>, link_updates: Option<AgentMeshLinkUpdates>, reply_callback: ReplyCallback<LinkEntityResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn link_entity_with_transform_error_option( &self, destination_agent_id: MeshId, emid: MeshEntityKeychainMeshId, destination_link_id: LinkRequestId, request_message: Option<WrappedMessage>, link_updates: Option<AgentMeshLinkUpdates>, transform_error: bool, reply_callback: ReplyCallback<LinkEntityResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn link_entity_via_delegate( &self, delegate_lemid: LinkedEntityKeychainMeshId, session_link: SessionLinkType, request_message: Option<WrappedMessage>, link_updates: Option<AgentMeshLinkUpdatesForSession>, reply_callback: ReplyCallback<LinkEntityViaDelegateResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub async fn async_link_entity_via_delegate( &self, delegate_lemid: LinkedEntityKeychainMeshId, session_link: SessionLinkType, request_message: Option<WrappedMessage>, link_updates: Option<AgentMeshLinkUpdatesForSession>, context_id: Option<ContextId>, ) -> Result<LinkEntityViaDelegateResult, MeshError>
pub fn unlink_entity( &self, lemid: LinkedEntityKeychainMeshId, reply_callback: ReplyCallback<()>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub async fn async_unlink_entity( &self, lemid: LinkedEntityKeychainMeshId, context_id: Option<ContextId>, ) -> Result<(), MeshError>
pub async fn async_unlink_entity_with_options( &self, lemid: LinkedEntityKeychainMeshId, ignore_not_found: bool, context_id: Option<ContextId>, ) -> Result<(), MeshError>
pub async fn async_delete_entity( &self, emid: MeshEntityKeychainMeshId, context_id: Option<ContextId>, ) -> Result<(), MeshError>
pub fn delete_entity( &self, emid: MeshEntityKeychainMeshId, reply_callback: ReplyCallback<()>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn lookup_linked_entities( &self, emid: MeshEntityKeychainMeshId, agent_ids: Option<Vec<AgentIdWithAttributes>>, external_ids: Option<Vec<MeshExternalId>>, reply_callback: ReplyCallback<LookupLinkedEntitiesResult>, offset: Option<u64>, limit: Option<u64>, include_deleted: Option<bool>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub async fn async_lookup_linked_entities( &self, emid: MeshEntityKeychainMeshId, agent_ids: Option<Vec<AgentIdWithAttributes>>, external_ids: Option<Vec<MeshExternalId>>, offset: Option<u64>, limit: Option<u64>, include_deleted: Option<bool>, context_id: Option<ContextId>, ) -> Result<LookupLinkedEntitiesResult, MeshError>
pub fn get_link_codes( &self, code_type: GetLinkCodesType, for_restriction: Option<GetLinkCodesForRestriction>, max_uses: Option<u64>, expiration_time: Option<i64>, request_message: Option<WrappedMessage>, reply_callback: ReplyCallback<GetLinkCodesResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub async fn async_get_link_codes( &self, code_type: GetLinkCodesType, for_restriction: Option<GetLinkCodesForRestriction>, max_uses: Option<u64>, expiration_time: Option<i64>, request_message: Option<WrappedMessage>, context_id: Option<ContextId>, ) -> Result<GetLinkCodesResult, MeshError>
pub fn update_link_info( &self, _lemid: LinkedEntityKeychainMeshId, _link_info: AgentMeshLinkInfo, _reply_callback: Box<dyn Fn(Result<UpdateLinkInfoResult, MeshError>) -> Result<Vec<MeshMessage>, MeshError> + Send>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn refresh_link_info( &self, _lemid: LinkedEntityKeychainMeshId, _link_info: AgentMeshLinkInfo, _reply_callback: Box<dyn Fn(Result<RefreshLinkInfoResult, MeshError>) -> Result<Vec<MeshMessage>, MeshError> + Send>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn check_permissions( &self, _lemid: LinkedEntityKeychainMeshId, _link_info: AgentMeshLinkInfo, _permissions: Vec<MeshPermission>, _reply_callback: Box<dyn Fn(Result<CheckPermissionsResult, MeshError>) -> Result<Vec<MeshMessage>, MeshError> + Send>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn check_permissions_inline( &self, _lemid: LinkedEntityKeychainMeshId, _link_info: AgentMeshLinkInfo, _permissions: Vec<MeshPermission>, ) -> Result<CheckPermissionsResult, MeshError>
pub fn send_message_to_entity_on_node_instance( &self, node_instance: MeshInstanceRoute, emid: MeshEntityKeychainMeshId, request_message: WrappedMessage, reply_callback: ReplyCallback<SendMessageToEntityOnNodeInstanceResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn send_message_to_linked_entity( &self, lemid: LinkedEntityKeychainMeshId, request_message: WrappedMessage, reply_callback: ReplyCallback<SendMessageToLinkedEntityResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn send_message_to_linked_entity_with_transform_error_option( &self, lemid: LinkedEntityKeychainMeshId, request_message: WrappedMessage, transform_error: bool, reply_callback: ReplyCallback<SendMessageToLinkedEntityResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub async fn async_send_message_to_linked_entity( &self, lemid: LinkedEntityKeychainMeshId, request_message: WrappedMessage, context_id: Option<ContextId>, ) -> Result<SendMessageToLinkedEntityResult, MeshError>
pub async fn async_send_message_to_linked_entity_with_transform_error_option( &self, lemid: LinkedEntityKeychainMeshId, request_message: WrappedMessage, transform_error: bool, context_id: Option<ContextId>, ) -> Result<SendMessageToLinkedEntityResult, MeshError>
pub async fn async_send_message_to_all_linked_entities( &self, emid: MeshEntityKeychainMeshId, destination_agent_id: AgentIdWithAttributes, request_message: WrappedMessage, context_id: Option<ContextId>, ) -> Result<SendMessageToAllLinkedEntitiesResult, MeshError>
pub fn send_message_to_all_linked_entities( &self, emid: MeshEntityKeychainMeshId, destination_agent_id: AgentIdWithAttributes, request_message: WrappedMessage, reply_callback: ReplyCallback<SendMessageToAllLinkedEntitiesResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn send_message_to_agent( &self, destination_agent_id: MeshId, request_message: WrappedMessage, reply_callback: ReplyCallback<SendMessageToAgentResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn send_message_to_agent_with_transform_error_option( &self, destination_agent_id: MeshId, request_message: WrappedMessage, transform_error: bool, reply_callback: ReplyCallback<SendMessageToAgentResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn send_message_to_agent_with_node_instance_and_timeout( &self, destination_agent_id: MeshId, request_message: WrappedMessage, expiration_ms: Option<i64>, node_instance: Option<MeshInstanceRoute>, transform_error: bool, reply_callback: ReplyCallback<SendMessageToAgentResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub async fn async_send_message_to_agent( &self, destination_agent_id: MeshId, request_message: WrappedMessage, context_id: Option<ContextId>, ) -> Result<SendMessageToAgentResult, MeshError>
pub async fn async_send_message_to_agent_with_node_instance_and_timeout( &self, destination_agent_id: MeshId, request_message: WrappedMessage, expiration_ms: Option<i64>, node_instance: Option<MeshInstanceRoute>, context_id: Option<ContextId>, ) -> Result<SendMessageToAgentResult, MeshError>
pub fn send_message_to_trustee( &self, destination_trustee_id: MeshId, request_message: WrappedMessage, reply_callback: ReplyCallback<SendMessageToTrusteeResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub async fn async_send_message_to_trustee( &self, destination_trustee_id: MeshId, request_message: WrappedMessage, context_id: Option<ContextId>, ) -> Result<SendMessageToTrusteeResult, MeshError>
pub fn update_uns_record_version_info( &self, source_id: MeshId, version_info: MeshVersionInfo, reply_callback: ReplyCallback<()>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub async fn async_update_uns_record_version_info( &self, source_id: MeshId, version_info: MeshVersionInfo, context_id: Option<ContextId>, ) -> Result<(), MeshError>
pub fn create_uns_records( &self, records: Vec<CreateUnsRecord>, is_agent_and_trustees: bool, reply_callback: ReplyCallback<CreateUnsRecordsResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub async fn async_create_uns_records( &self, records: Vec<CreateUnsRecord>, is_agent_and_trustees: bool, context_id: Option<ContextId>, ) -> Result<CreateUnsRecordsResult, MeshError>
pub fn lookup_uns_records( &self, lookup: UnsLookupType, bypass_cache: bool, get_trustees_if_agent: bool, reply_callback: ReplyCallback<LookupUnsRecordsResult>, context_id: Option<ContextId>, ) -> Result<Vec<MeshMessage>, MeshError>
pub async fn async_lookup_uns_records( &self, lookup: UnsLookupType, bypass_cache: bool, get_trustees_if_agent: bool, context_id: Option<ContextId>, ) -> Result<LookupUnsRecordsResult, MeshError>
pub fn get_source_and_destination(&self) -> (MeshId, MeshId)
pub fn get_agent_emid(&self) -> Result<MeshEntityKeychainMeshId, MeshError>
pub fn set_agent_emid(&self, agent_emid: MeshEntityKeychainMeshId)
pub fn get_agent_id(&self) -> MeshId
pub fn get_listener_subsystem(&self) -> Option<MeshSubsystem>
pub async fn async_mutate_emid_data( &self, emid: MeshEntityKeychainMeshId, key_path: Vec<Vec<u8>>, mutate_callback: Box<dyn Fn(&mut DataEntry) -> Result<Option<MutateCallbackResultData>, MeshError> + Send + Sync>, context_id: Option<ContextId>, ) -> Result<MutateReplyData, MeshError>
pub async fn async_mutate_emid_data_with_part_number( &self, emid: MeshEntityKeychainMeshId, key_path: Vec<Vec<u8>>, part_number: i64, mutate_callback: Box<dyn Fn(&mut DataEntry) -> Result<Option<MutateCallbackResultData>, MeshError> + Send + Sync>, context_id: Option<ContextId>, ) -> Result<MutateReplyData, MeshError>
pub async fn async_mutate_lemid_data( &self, emid: MeshEntityKeychainMeshId, lemid: LinkedEntityKeychainMeshId, key_path: Vec<Vec<u8>>, mutate_callback: Box<dyn Fn(&mut DataEntry) -> Result<Option<MutateCallbackResultData>, MeshError> + Send + Sync>, context_id: Option<ContextId>, ) -> Result<MutateReplyData, MeshError>
pub async fn async_get_lock_for_node( &self, name: &str, lock_timeout_ms: i64, context_id: Option<ContextId>, ) -> Result<bool, MeshError>
pub async fn async_mutate_emid_data_with_async_callback<F, Fut>( &self, emid: MeshEntityKeychainMeshId, key_path: Vec<Vec<u8>>, mutate_callback: F, context_id: Option<ContextId>, ) -> Result<MutateReplyData, MeshError>
pub async fn async_mutate_lemid_data_with_async_callback<F, Fut>( &self, emid: MeshEntityKeychainMeshId, lemid: LinkedEntityKeychainMeshId, key_path: Vec<Vec<u8>>, mutate_callback: F, context_id: Option<ContextId>, ) -> Result<MutateReplyData, MeshError>
source§impl AgentHandler
impl AgentHandler
source§impl AgentHandler
impl AgentHandler
source§impl AgentHandler
impl AgentHandler
pub fn register_link_via_delegate_handler( &mut self, request_handler: Box<RequestHandler>, )
pub fn register_link_via_delegate_session_handler( &mut self, request_handler: Box<RequestHandler>, )
pub fn register_link_entity_handler( &mut self, request_handler: Box<RequestHandler>, )
pub fn register_link_entity_pre_create_handler( &mut self, request_handler: Box<RequestHandler>, )
pub fn register_link_entity_post_create_handler( &mut self, request_handler: Box<RequestHandler>, )
pub fn register_get_link_codes_handler( &mut self, request_handler: Box<RequestHandler>, )
pub fn register_create_temp_entity_handler( &mut self, request_handler: Box<RequestHandler>, )
pub fn register_merge_temp_entity_handler( &mut self, request_handler: Box<RequestHandler>, )
pub fn register_unlink_entities_handler( &mut self, request_handler: Box<RequestHandler>, )
pub fn register_handler( &mut self, subsystem: MeshSubsystem, message_type: MeshMessageType, request_handler: Box<RequestHandler>, )
pub fn register_handler_set_include_pre_creates( &mut self, subsystem: MeshSubsystem, message_type: MeshMessageType, request_handler: Box<RequestHandler>, include_pre_creates: bool, )
pub fn send_reply_for_handler( &self, state_id: MeshId, reply_data: AgentHandlerRoutingResponseType, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn send_error_for_handler( &self, state_id: MeshId, err: MeshError, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn send_error_status_for_handler( &self, state_id: MeshId, status: MeshStatusType, status_message: Option<String>, ) -> Result<Vec<MeshMessage>, MeshError>
pub fn register_default_link_via_delegate_handler(&mut self)
pub fn register_default_link_via_delegate_handler_with_autorization_check( &mut self, authorization_handler: Box<AuthorizationHandler>, )
pub fn register_default_get_link_codes_handler(&mut self)
pub fn register_default_get_link_codes_handler_with_autorization_check( &mut self, authorization_handler: Box<AuthorizationHandler>, )
Trait Implementations§
source§impl Clone for AgentHandler
impl Clone for AgentHandler
source§fn clone(&self) -> AgentHandler
fn clone(&self) -> AgentHandler
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for AgentHandler
impl RefUnwindSafe for AgentHandler
impl Send for AgentHandler
impl Sync for AgentHandler
impl Unpin for AgentHandler
impl UnwindSafe for AgentHandler
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)