[−][src]Struct transact::context::manager::sync::ContextManager
A thread-safe 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
Constructs a new Context Manager around a given state Read.
The Read defines the state on which the context built.
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>
Return a set of values from a context.
The values are returned as key-value tuples
Errors
Returns an error if the context id does not exist, or an error occurs while reading from the underlying state.
pub fn set_state(
&self,
context_id: &ContextId,
key: String,
value: Vec<u8>
) -> Result<(), ContextManagerError>
[src]
&self,
context_id: &ContextId,
key: String,
value: Vec<u8>
) -> Result<(), ContextManagerError>
Errors
Returns an error if the context id does not exist, or an error occurs while reading from the underlying state.
pub fn delete_state(
&self,
context_id: &ContextId,
key: &str
) -> Result<Option<Vec<u8>>, ContextManagerError>
[src]
&self,
context_id: &ContextId,
key: &str
) -> Result<Option<Vec<u8>>, ContextManagerError>
pub fn add_event(
&self,
context_id: &ContextId,
event: Event
) -> Result<(), ContextManagerError>
[src]
&self,
context_id: &ContextId,
event: Event
) -> Result<(), ContextManagerError>
pub fn add_data(
&self,
context_id: &ContextId,
data: Vec<u8>
) -> Result<(), ContextManagerError>
[src]
&self,
context_id: &ContextId,
data: Vec<u8>
) -> Result<(), ContextManagerError>
Trait Implementations
impl Clone for ContextManager
[src]
fn clone(&self) -> ContextManager
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
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>
Auto Trait Implementations
impl RefUnwindSafe for ContextManager
impl Send for ContextManager
impl Sync for ContextManager
impl Unpin for ContextManager
impl UnwindSafe for ContextManager
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> DefaultFeatures<'a> for T where
T: 'a + Clone + Send + Sync,
T: 'a + Clone + Send + Sync,
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a>
fn self_address_mut(&mut self) -> *mut ()
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
T: 'a + Clone,
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a>
fn self_address_mut(&mut self) -> *mut ()
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
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut 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>,