Struct tendermint_light_client::store::memory::MemoryStore

source ·
pub struct MemoryStore { /* private fields */ }
Expand description

Transient in-memory store.

Implementations§

source§

impl MemoryStore

source

pub fn new() -> Self

Create a new, empty, in-memory store

Trait Implementations§

source§

impl Clone for MemoryStore

source§

fn clone(&self) -> MemoryStore

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MemoryStore

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for MemoryStore

source§

fn default() -> MemoryStore

Returns the “default value” for a type. Read more
source§

impl LightStore for MemoryStore

source§

fn get(&self, height: Height, status: Status) -> Option<LightBlock>

Get the light block at the given height with the given status, or return None otherwise.
source§

fn insert(&mut self, light_block: LightBlock, status: Status)

Insert a new light block in the store with the given status. Overrides any other block with the same height and status.
source§

fn remove(&mut self, height: Height, status: Status)

Remove the light block with the given height and status, if any.
source§

fn update(&mut self, light_block: &LightBlock, status: Status)

Update the status of the given light_block.
source§

fn highest(&self, status: Status) -> Option<LightBlock>

Get the light block of greatest height with the given status.
source§

fn highest_before(&self, height: Height, status: Status) -> Option<LightBlock>

Get the light block of greatest height before the given height with the given status.
source§

fn lowest(&self, status: Status) -> Option<LightBlock>

Get the light block of lowest height with the given status.
source§

fn all(&self, status: Status) -> Box<dyn Iterator<Item = LightBlock>>

Get an iterator of all light blocks with the given status.
source§

fn get_non_failed(&self, height: Height) -> Option<(LightBlock, Status)>

Get a block at a given height whatever its verification status as long as it hasn’t failed verification (ie. its status is not Status::Failed).
source§

fn highest_trusted_or_verified(&self) -> Option<LightBlock>

Get the light block of greatest height with the trusted or verified status.
source§

fn highest_trusted_or_verified_before( &self, height: Height ) -> Option<LightBlock>

Get the first light block before the given height with the trusted or verified status.
source§

fn lowest_trusted_or_verified(&self) -> Option<LightBlock>

Get the light block of lowest height with the trusted or verified status.
source§

fn get_trusted_or_verified(&self, height: Height) -> Option<LightBlock>

Get the light block of the given height with the trusted or verified status.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more