Trait RemotesManager

Source
pub trait RemotesManager:
    Send
    + Sync
    + Lifecycle {
    // Required methods
    fn get_all(&self) -> Vec<InstanceInfo>;
    fn get(&self, address: &InstanceAddress) -> Option<InstanceInfo>;
    fn has(&self, address: &InstanceAddress) -> bool;
    fn get_all_addresses(&self) -> HashSet<InstanceAddress>;
    fn add<'life0, 'life1, 'async_trait>(
        &'life0 self,
        address: &'life1 InstanceAddress,
    ) -> Pin<Box<dyn Future<Output = Result<InstanceInfo, FailedToAddInstance>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove(&self, address: &InstanceAddress) -> bool;
    fn remove_all(&self);
    fn update<'life0, 'life1, 'async_trait>(
        &'life0 self,
        address: &'life1 InstanceAddress,
    ) -> Pin<Box<dyn Future<Output = Result<InstanceInfo, FailedToUpdateInstance>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update_all<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<InstanceInfo>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn fetch_and_add_remotes_from_remote<'life0, 'life1, 'async_trait>(
        &'life0 self,
        address: &'life1 InstanceAddress,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<InstanceInfo>, FailedToFetchRemoteInstances>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn fetch_and_add_remotes_from_all_remotes<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<InstanceInfo>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Manages the list of remote instances.

Required Methods§

Source

fn get_all(&self) -> Vec<InstanceInfo>

Returns the remote instances.

Source

fn get(&self, address: &InstanceAddress) -> Option<InstanceInfo>

Returns the instance info with the given address.

Source

fn has(&self, address: &InstanceAddress) -> bool

Returns true if the given address is registered.

Source

fn get_all_addresses(&self) -> HashSet<InstanceAddress>

Returns a list of the addresses of the remote instances.

Source

fn add<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 InstanceAddress, ) -> Pin<Box<dyn Future<Output = Result<InstanceInfo, FailedToAddInstance>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Adds a remote instance.

Source

fn remove(&self, address: &InstanceAddress) -> bool

Removes a remote instance.

Source

fn remove_all(&self)

Removes all remote instances.

Source

fn update<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 InstanceAddress, ) -> Pin<Box<dyn Future<Output = Result<InstanceInfo, FailedToUpdateInstance>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Updates a remote instance.

Source

fn update_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<InstanceInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Removes all remote instances.

Source

fn fetch_and_add_remotes_from_remote<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 InstanceAddress, ) -> Pin<Box<dyn Future<Output = Result<Vec<InstanceInfo>, FailedToFetchRemoteInstances>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetches and adds all remote instances of the given remote instance.

Source

fn fetch_and_add_remotes_from_all_remotes<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<InstanceInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetches and adds all remote instances of all remote instances.

Trait Implementations§

Source§

impl Injectable for dyn RemotesManager + Sync + Send

Implementors§