pub struct MemorySurbStore { /* private fields */ }Expand description
Basic SurbStore implementation based on an in-memory cache.
This SURB store offers no persistence, and all SURBs and Reply Openers are lost once dropped.
The instance can be cheaply cloned.
Implementations§
Source§impl MemorySurbStore
impl MemorySurbStore
Sourcepub fn new(cfg: SurbStoreConfig) -> Self
pub fn new(cfg: SurbStoreConfig) -> Self
Creates a new instance with the given configuration.
Trait Implementations§
Source§impl Clone for MemorySurbStore
impl Clone for MemorySurbStore
Source§fn clone(&self) -> MemorySurbStore
fn clone(&self) -> MemorySurbStore
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 moreSource§impl Default for MemorySurbStore
impl Default for MemorySurbStore
Source§impl SurbStore for MemorySurbStore
impl SurbStore for MemorySurbStore
Source§fn find_surb<'life0, 'async_trait>(
&'life0 self,
matcher: SurbMatcher,
) -> Pin<Box<dyn Future<Output = Option<FoundSurb>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_surb<'life0, 'async_trait>(
&'life0 self,
matcher: SurbMatcher,
) -> Pin<Box<dyn Future<Output = Option<FoundSurb>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn insert_surbs<'life0, 'async_trait>(
&'life0 self,
pseudonym: HoprPseudonym,
surbs: Vec<(HoprSurbId, HoprSurb)>,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn insert_surbs<'life0, 'async_trait>(
&'life0 self,
pseudonym: HoprPseudonym,
surbs: Vec<(HoprSurbId, HoprSurb)>,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn insert_reply_opener(&self, sender_id: HoprSenderId, opener: ReplyOpener)
fn insert_reply_opener(&self, sender_id: HoprSenderId, opener: ReplyOpener)
Source§fn find_reply_opener(&self, sender_id: &HoprSenderId) -> Option<ReplyOpener>
fn find_reply_opener(&self, sender_id: &HoprSenderId) -> Option<ReplyOpener>
Auto Trait Implementations§
impl Freeze for MemorySurbStore
impl !RefUnwindSafe for MemorySurbStore
impl Send for MemorySurbStore
impl Sync for MemorySurbStore
impl Unpin for MemorySurbStore
impl !UnwindSafe for MemorySurbStore
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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