Struct lumina_node::store::InMemoryStore
source · pub struct InMemoryStore { /* private fields */ }Expand description
A non-persistent in memory Store implementation.
Implementations§
source§impl InMemoryStore
impl InMemoryStore
Trait Implementations§
source§impl Clone for InMemoryStore
impl Clone for InMemoryStore
source§impl Debug for InMemoryStore
impl Debug for InMemoryStore
source§impl Default for InMemoryStore
impl Default for InMemoryStore
source§impl Store for InMemoryStore
impl Store for InMemoryStore
source§fn get_head<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ExtendedHeader, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_head<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ExtendedHeader, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the
ExtendedHeader with the highest height.source§fn get_by_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash
) -> Pin<Box<dyn Future<Output = Result<ExtendedHeader, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_by_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash
) -> Pin<Box<dyn Future<Output = Result<ExtendedHeader, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns the header of a specific hash.
source§fn get_by_height<'life0, 'async_trait>(
&'life0 self,
height: u64
) -> Pin<Box<dyn Future<Output = Result<ExtendedHeader, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_by_height<'life0, 'async_trait>(
&'life0 self,
height: u64
) -> Pin<Box<dyn Future<Output = Result<ExtendedHeader, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the header of a specific height.
source§fn wait_height<'life0, 'async_trait>(
&'life0 self,
height: u64
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn wait_height<'life0, 'async_trait>(
&'life0 self,
height: u64
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns when
height is available in the Store.source§fn head_height<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn head_height<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the highest known height.
source§fn has<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 Hash
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns true if hash exists in the store.
source§fn has_at<'life0, 'async_trait>(
&'life0 self,
height: u64
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn has_at<'life0, 'async_trait>(
&'life0 self,
height: u64
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns true if height exists in the store.
source§fn append_single_unchecked<'life0, 'async_trait>(
&'life0 self,
header: ExtendedHeader
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_single_unchecked<'life0, 'async_trait>(
&'life0 self,
header: ExtendedHeader
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Append single header maintaining continuity from the genesis to the head. Read more
source§fn next_unsampled_height<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next_unsampled_height<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns height of the lowest header that wasn’t sampled yet
source§fn update_sampling_metadata<'life0, 'async_trait>(
&'life0 self,
height: u64,
accepted: bool,
cids: Vec<Cid>
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_sampling_metadata<'life0, 'async_trait>(
&'life0 self,
height: u64,
accepted: bool,
cids: Vec<Cid>
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets or updates sampling result for the header. Read more
source§fn get_sampling_metadata<'life0, 'async_trait>(
&'life0 self,
height: u64
) -> Pin<Box<dyn Future<Output = Result<Option<SamplingMetadata>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_sampling_metadata<'life0, 'async_trait>(
&'life0 self,
height: u64
) -> Pin<Box<dyn Future<Output = Result<Option<SamplingMetadata>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the sampling metadata for the height. Read more
source§fn get_range<'life0, 'async_trait, R>(
&'life0 self,
range: R
) -> Pin<Box<dyn Future<Output = Result<Vec<ExtendedHeader>, StoreError>> + Send + 'async_trait>>
fn get_range<'life0, 'async_trait, R>( &'life0 self, range: R ) -> Pin<Box<dyn Future<Output = Result<Vec<ExtendedHeader>, StoreError>> + Send + 'async_trait>>
Returns the headers from the given heights range. Read more
source§fn append_unchecked<'life0, 'async_trait>(
&'life0 self,
headers: Vec<ExtendedHeader>
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_unchecked<'life0, 'async_trait>(
&'life0 self,
headers: Vec<ExtendedHeader>
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Append a range of headers maintaining continuity from the genesis to the head. Read more
source§fn append_single<'life0, 'async_trait>(
&'life0 self,
header: ExtendedHeader
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_single<'life0, 'async_trait>(
&'life0 self,
header: ExtendedHeader
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Append single header maintaining continuity from the genesis to the head.
Auto Trait Implementations§
impl !Freeze for InMemoryStore
impl !RefUnwindSafe for InMemoryStore
impl Send for InMemoryStore
impl Sync for InMemoryStore
impl Unpin for InMemoryStore
impl UnwindSafe for InMemoryStore
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> 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