pub struct DHTStorage {
pub broker: Broker<DHTStorageIn, DHTStorageOut>,
pub stats: Receiver<Stats>,
/* private fields */
}Expand description
This links the DHTStorage module with other modules, so that all messages are correctly translated from one to the other. For this example, it uses the RandomConnections module to communicate with other nodes.
The DHTStorage holds the [Translate] and offers convenience methods to interact with [Translate] and [DHTStorageMessage].
Fields§
§broker: Broker<DHTStorageIn, DHTStorageOut>Represents the underlying broker.
stats: Receiver<Stats>Implementations§
Source§impl DHTStorage
impl DHTStorage
pub async fn start( ds: Box<dyn DataStorage + Send>, config: DHTConfig, timer: BrokerTimer, dht_router: BrokerDHTRouter, ) -> Result<Self>
pub fn store_flo(&mut self, flo: Flo) -> Result<()>
pub fn propagate(&mut self) -> Result<()>
pub async fn get_realm_ids(&mut self) -> Result<Vec<RealmID>>
pub async fn get_flo<T: Serialize + DeserializeOwned + Clone>( &mut self, id: &GlobalID, ) -> Result<FloWrapper<T>>
pub async fn get_flo_timeout<T: Serialize + DeserializeOwned + Clone>( &mut self, id: &GlobalID, timeout: u64, ) -> Result<FloWrapper<T>>
pub async fn get_flos(&mut self) -> Result<Vec<Flo>>
pub async fn get_cuckoos(&mut self, id: &GlobalID) -> Result<Vec<FloID>>
pub fn sync(&mut self) -> Result<()>
pub fn convert<'life0, 'life1, 'life_self, 'async_recursion>(
&'life_self mut self,
cl: &'life0 ConditionLink,
rid: &'life1 RealmID,
) -> Pin<Box<dyn Future<Output = Condition> + 'async_recursion>>where
'life0: 'async_recursion,
'life1: 'async_recursion,
'life_self: 'async_recursion,
pub async fn start_sign_cond<T: Serialize + DeserializeOwned + Clone>( &mut self, fw: &FloWrapper<T>, cl: &ConditionLink, ) -> Result<UpdateCondSign>
pub async fn get_realm_view(&mut self, rid: RealmID) -> Result<RealmView>
Trait Implementations§
Source§impl Clone for DHTStorage
impl Clone for DHTStorage
Source§fn clone(&self) -> DHTStorage
fn clone(&self) -> DHTStorage
Returns a duplicate 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 DHTStorage
impl !RefUnwindSafe for DHTStorage
impl Send for DHTStorage
impl Sync for DHTStorage
impl Unpin for DHTStorage
impl !UnwindSafe for DHTStorage
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more