Communicator

Trait Communicator 

Source
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§

Source

fn liveliness_subscribers( &self, ) -> Arc<RwLock<HashMap<String, Box<dyn LivelinessSubscriber>>>>

Get the liveliness subscribers

Source

fn observers(&self) -> Arc<RwLock<HashMap<String, Box<dyn Observer>>>>

Get the observers

Source

fn publishers(&self) -> Arc<RwLock<HashMap<String, Box<dyn Publisher>>>>

Get the publishers

Source

fn queriers(&self) -> Arc<RwLock<HashMap<String, Box<dyn Querier>>>>

Get the queriers

Source

fn responders(&self) -> Arc<RwLock<HashMap<String, Box<dyn Responder>>>>

Get the responders

Source

fn uuid(&self) -> String

the uuid of the communicator

Source

fn mode(&self) -> &String

the mode of the communicator

Source

fn default_session(&self) -> Arc<Session>

get the default session

Source

fn session(&self, id: &str) -> Option<Arc<Session>>

get the session with id

Source

fn sessions(&self) -> Vec<Arc<Session>>

get all sessions

Provided Methods§

Source

fn upgrade_capabilities(&self, new_state: &OperationState) -> Result<()>

Method for upgrading OperationState all registered capabilities

The capabilities are upgraded in the order

§Errors

Currently none

Source

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

Implementors§