Skip to main content

MemStore

Struct MemStore 

Source
pub struct MemStore { /* private fields */ }
Expand description

An in-memory MessageStore. The default, and all a CSMS ever needs.

A Charging Station should swap in a store that survives a reboot.

Implementations§

Source§

impl MemStore

Source

pub fn new() -> Self

An unbounded in-memory store.

Source

pub fn bounded(capacity: usize) -> Self

A store that refuses to grow beyond capacity messages.

Source

pub fn entries(&self) -> Vec<&QueuedCall>

Every queued message, oldest first.

Trait Implementations§

Source§

impl Debug for MemStore

Source§

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

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

impl Default for MemStore

Source§

fn default() -> Self

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

impl MessageStore for MemStore

Source§

fn push(&mut self, entry: &QueuedCall) -> Result<Seq, StoreError>

Appends a message, returning its sequence number.
Source§

fn pending(&self) -> Result<Vec<(Seq, QueuedCall)>, StoreError>

Every un-acknowledged message, oldest first. Read more
Source§

fn ack(&mut self, seq: Seq) -> Result<(), StoreError>

Removes a message that has been delivered (or definitively abandoned).
Source§

fn set_attempts(&mut self, seq: Seq, attempts: u32) -> Result<(), StoreError>

Records a further transmission attempt for a message that is still queued.
Source§

fn len(&self) -> Result<usize, StoreError>

How many messages are waiting. Read more
Source§

fn is_empty(&self) -> Result<bool, StoreError>

Whether the store is empty.

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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.