Skip to main content

HotStore

Struct HotStore 

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

In-memory mirror of the postbox; disk is touched only on HotStore::flush.

Implementations§

Source§

impl HotStore

Source

pub fn load(home: &UnifierHome) -> Result<Self>

Source

pub fn is_dirty(&self) -> bool

Source

pub fn put_key(&mut self, key: &str, value: &str) -> Result<()>

Source

pub fn get_key(&self, key: &str) -> Result<Option<String>>

Source

pub fn delete_key(&mut self, key: &str) -> Result<bool>

Source

pub fn send(&mut self, recipient: &str, body: &str) -> Result<Uuid>

Source

pub fn send_from( &mut self, from: &str, recipient: &str, body: &str, ) -> Result<Uuid>

Source

pub fn post_cron(&mut self, schedule: &str, body: &str) -> Result<Uuid>

Source

pub fn poll_mailbox(&self, recipient: &str) -> Result<Vec<Message>>

Source

pub fn poll_cron(&self) -> Result<Vec<Message>>

Source

pub fn list_dir( &self, home: &UnifierHome, subpath: &str, ) -> Result<Vec<Message>>

Source

pub fn ack(&mut self, home: &UnifierHome, id_or_path: &str) -> Result<bool>

Source

pub fn flush(&mut self, home: &UnifierHome) -> Result<()>

Source§

impl HotStore

Source

pub fn tick_start(&mut self, label: &str) -> Result<TickStartOutcome>

Source

pub fn tick_end(&mut self, home: &UnifierHome) -> Result<u64>

Source

pub fn tick_status(&self) -> TickStatus

Source

pub fn tick_lock(&mut self, key: &str) -> Result<()>

Source

pub fn tick_unlock(&mut self, key: &str) -> Result<bool>

Source

pub fn post_event(&mut self, payload: &str) -> Result<Uuid>

Source

pub fn send_agent_message( &mut self, from: &str, to: &str, payload: &str, ) -> Result<Uuid>

Trait Implementations§

Source§

impl Debug for HotStore

Source§

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

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

impl Default for HotStore

Source§

fn default() -> HotStore

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

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.