Struct lumina_node::store::SledStore
source · pub struct SledStore { /* private fields */ }Implementations§
source§impl SledStore
impl SledStore
sourcepub async fn new(network_id: String) -> Result<Self, StoreError>
pub async fn new(network_id: String) -> Result<Self, StoreError>
Create or open a persistent store.
sourcepub async fn new_temp() -> Result<Self, StoreError>
pub async fn new_temp() -> Result<Self, StoreError>
Create a persistent store in a temporary directory.
sourcepub async fn new_in_path<P>(path: P) -> Result<Self, StoreError>
pub async fn new_in_path<P>(path: P) -> Result<Self, StoreError>
Create a persistent store in a given path.
sourcepub async fn flush_to_storage(&self) -> Result<(), StoreError>
pub async fn flush_to_storage(&self) -> Result<(), StoreError>
Flush the store’s state to the filesystem.
Trait Implementations§
source§impl Store for SledStore
impl Store for SledStore
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 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 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 !RefUnwindSafe for SledStore
impl Send for SledStore
impl Sync for SledStore
impl Unpin for SledStore
impl !UnwindSafe for SledStore
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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