[−][src]Struct transact::context::manager::ContextManager
Methods
impl ContextManager
[src]
pub fn new(
database: Box<dyn Read<StateId = String, Key = String, Value = Vec<u8>>>
) -> Self
[src]
database: Box<dyn Read<StateId = String, Key = String, Value = Vec<u8>>>
) -> Self
pub fn get(
&self,
context_id: &ContextId,
keys: &[String]
) -> Result<Vec<(String, Vec<u8>)>, ContextManagerError>
[src]
&self,
context_id: &ContextId,
keys: &[String]
) -> Result<Vec<(String, Vec<u8>)>, ContextManagerError>
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]
&mut self,
context_id: &ContextId,
key: String,
value: Vec<u8>
) -> Result<(), ContextManagerError>
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]
&mut self,
context_id: &ContextId,
key: &str
) -> Result<Option<Vec<u8>>, ContextManagerError>
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]
&mut self,
context_id: &ContextId,
event: Event
) -> Result<(), ContextManagerError>
Adds an Event to the specified Context.
pub fn add_data(
&mut self,
context_id: &ContextId,
data: Vec<u8>
) -> Result<(), ContextManagerError>
[src]
&mut self,
context_id: &ContextId,
data: Vec<u8>
) -> Result<(), ContextManagerError>
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]
&mut self,
dependent_contexts: &[ContextId],
state_id: &str
) -> ContextId
Creates a Context, and returns the resulting ContextId.
fn drop_context(&mut self, _context_id: ContextId)
[src]
fn get_transaction_receipt(
&self,
context_id: &ContextId,
transaction_id: &str
) -> Result<TransactionReceipt, ContextManagerError>
[src]
&self,
context_id: &ContextId,
transaction_id: &str
) -> Result<TransactionReceipt, ContextManagerError>
Creates a TransactionReceipt based on the information available within the specified Context.
Auto Trait Implementations
impl Send for ContextManager
impl Unpin for ContextManager
impl !Sync for ContextManager
impl !UnwindSafe for ContextManager
impl !RefUnwindSafe for ContextManager
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SafeBorrow<T> for T where
T: ?Sized,
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
impl<T> Same<T> for T
type Output = T
Should always be Self