[][src]Struct transact::context::Context

pub struct Context { /* fields omitted */ }

Methods

impl Context[src]

pub fn new(state_id: &str, base_contexts: Vec<ContextId>) -> Self[src]

pub fn base_contexts(&self) -> &[ContextId][src]

pub fn events(&self) -> &Vec<Event>[src]

pub fn state_changes(&self) -> &Vec<StateChange>[src]

pub fn id(&self) -> &ContextId[src]

pub fn data(&self) -> &Vec<Vec<u8>>[src]

pub fn state_id(&self) -> &String[src]

pub fn add_event(&mut self, event: Event)[src]

pub fn add_data(&mut self, data: Vec<u8>)[src]

pub fn get_state(&self, key: &str) -> Option<&[u8]>[src]

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

Adds StateChange::Set without deleting previous StateChanges associated with the Key

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

Adds StateChange::Delete and returns the value associated to the key being deleted

pub fn contains(&self, key: &str) -> bool[src]

Checks to see if the Key is referenced by any StateChanges within the Context

Trait Implementations

impl Default for Context[src]

impl Clone for Context[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Context[src]

Auto Trait Implementations

impl Send for Context

impl Sync for Context

Blanket Implementations

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Send + Sync + Clone

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone

impl<T> Same<T> for T

type Output = T

Should always be Self