pub trait Communicator:
Capability
+ CommunicatorMethods
+ Send
+ Sync {
// Required methods
fn liveliness_subscribers(
&self,
) -> Arc<RwLock<HashMap<String, Box<dyn LivelinessSubscriber>>>>;
fn observers(&self) -> Arc<RwLock<HashMap<String, Box<dyn Observer>>>>;
fn publishers(&self) -> Arc<RwLock<HashMap<String, Box<dyn Publisher>>>>;
fn queriers(&self) -> Arc<RwLock<HashMap<String, Box<dyn Querier>>>>;
fn responders(&self) -> Arc<RwLock<HashMap<String, Box<dyn Responder>>>>;
fn uuid(&self) -> String;
fn mode(&self) -> &String;
fn default_session(&self) -> Arc<Session>;
fn session(&self, id: &str) -> Option<Arc<Session>>;
fn sessions(&self) -> Vec<Arc<Session>>;
// Provided methods
fn upgrade_capabilities(&self, new_state: &OperationState) -> Result<()> { ... }
fn downgrade_capabilities(&self, new_state: &OperationState) -> Result<()> { ... }
}Expand description
the methodes to be implemented by any communicator
Required Methods§
Sourcefn liveliness_subscribers(
&self,
) -> Arc<RwLock<HashMap<String, Box<dyn LivelinessSubscriber>>>>
fn liveliness_subscribers( &self, ) -> Arc<RwLock<HashMap<String, Box<dyn LivelinessSubscriber>>>>
Get the liveliness subscribers
Sourcefn default_session(&self) -> Arc<Session>
fn default_session(&self) -> Arc<Session>
get the default session
Provided Methods§
Sourcefn upgrade_capabilities(&self, new_state: &OperationState) -> Result<()>
fn upgrade_capabilities(&self, new_state: &OperationState) -> Result<()>
Method for upgrading OperationState all registered capabilities
The capabilities are upgraded in the order
LivelinessSubscribersResponder:Observable,Queryable,SubscriberPublishers theObservers and theQueriers
§Errors
Currently none
Sourcefn downgrade_capabilities(&self, new_state: &OperationState) -> Result<()>
fn downgrade_capabilities(&self, new_state: &OperationState) -> Result<()>
Method for downgrading OperationState all registered capabilities
The capabilities are downgraded in reverse order of their start in Communicator::upgrade_capabilities
§Errors
Currently none