[][src]Struct transact::context::manager::ContextManager

pub struct ContextManager { /* fields omitted */ }

Methods

impl ContextManager[src]

pub fn new(
    database: Box<dyn Read<StateId = String, Key = String, Value = Vec<u8>>>
) -> Self
[src]

pub fn get(
    &self,
    context_id: &ContextId,
    keys: &[String]
) -> Result<Vec<(String, Vec<u8>)>, ContextManagerError>
[src]

Get the values associated with list of keys, from a specific Context. If a key is not found in the context, State is then checked for these keys. Keys are returned with the associated value, if found in Context or State.

pub fn set_state(
    &mut self,
    context_id: &ContextId,
    key: String,
    value: Vec<u8>
) -> Result<(), ContextManagerError>
[src]

Adds a StateChange::Set to the specified Context

pub fn delete_state(
    &mut self,
    context_id: &ContextId,
    key: &str
) -> Result<Option<Vec<u8>>, ContextManagerError>
[src]

Adds a StateChange::Delete to the specified Context, returning the value, if found, that is associated with the specified key.

pub fn add_event(
    &mut self,
    context_id: &ContextId,
    event: Event
) -> Result<(), ContextManagerError>
[src]

Adds an Event to the specified Context.

pub fn add_data(
    &mut self,
    context_id: &ContextId,
    data: Vec<u8>
) -> Result<(), ContextManagerError>
[src]

Adds Data to the specified Context.

Trait Implementations

impl ContextLifecycle for ContextManager[src]

fn create_context(
    &mut self,
    dependent_contexts: &[ContextId],
    state_id: &str
) -> ContextId
[src]

Creates a Context, and returns the resulting ContextId.

fn get_transaction_receipt(
    &self,
    context_id: &ContextId,
    transaction_id: &str
) -> Result<TransactionReceipt, ContextManagerError>
[src]

Creates a TransactionReceipt based on the information available within the specified Context.

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self