pub struct Dio { /* private fields */ }Expand description
Represents a series of mutations that the user is making on a particular chain-of-trust with a specific set of facts attached to a session. All changes are stored in memory until the commit function is invoked which will feed them into the chain.
If you decide to abort the transaction then call the cancel function before it goes
out of scope however if you mutate data and do not call commit then the data will be
lost (or an assert will be triggerd when in Debug mode).
These objects are multi-thread safe and allow for very high concurrency through async operations.
When setting the scope for the DIO it will behave differently when the commit function is invoked based on what scope you set for the transaction.
Implementations
sourceimpl Dio
impl Dio
pub fn chain(&self) -> &Arc<Chain>
pub fn remote<'a>(&'a self) -> Option<&'a Url>
pub async fn load_raw(
self: &Arc<Self>,
key: &PrimaryKey
) -> Result<EventStrongData, LoadError>
pub async fn load<D>(
self: &Arc<Self>,
key: &PrimaryKey
) -> Result<Dao<D>, LoadError> where
D: DeserializeOwned,
pub async fn load_and_take<D>(
self: &Arc<Self>,
key: &PrimaryKey
) -> Result<D, LoadError> where
D: DeserializeOwned,
pub async fn exists(&self, key: &PrimaryKey) -> bool
pub async fn children_keys(
self: &Arc<Self>,
parent_id: PrimaryKey,
collection_id: u64
) -> Result<Vec<PrimaryKey>, LoadError>
pub async fn __children_keys(
self: &Arc<Self>,
parent_id: PrimaryKey,
collection_id: u64
) -> Result<Vec<PrimaryKey>, LoadError>
pub async fn root_keys(self: &Arc<Self>) -> Vec<PrimaryKey>
pub async fn __root_keys(self: &Arc<Self>) -> Vec<PrimaryKey>
pub async fn all_keys(self: &Arc<Self>) -> Vec<PrimaryKey>
pub async fn __all_keys(self: &Arc<Self>) -> Vec<PrimaryKey>
pub async fn children<D>(
self: &Arc<Self>,
parent_id: PrimaryKey,
collection_id: u64
) -> Result<Vec<Dao<D>>, LoadError> where
D: DeserializeOwned,
pub async fn children_ext<D>(
self: &Arc<Self>,
parent_id: PrimaryKey,
collection_id: u64,
allow_missing_keys: bool,
allow_serialization_error: bool
) -> Result<Vec<Dao<D>>, LoadError> where
D: DeserializeOwned,
pub async fn roots<D>(self: &Arc<Self>) -> Result<Vec<Dao<D>>, LoadError> where
D: DeserializeOwned,
pub async fn roots_ext<D>(
self: &Arc<Self>,
allow_missing_keys: bool,
allow_serialization_error: bool
) -> Result<Vec<Dao<D>>, LoadError> where
D: DeserializeOwned,
pub async fn load_many<D>(
self: &Arc<Self>,
keys: impl Iterator<Item = PrimaryKey>
) -> Result<Vec<Dao<D>>, LoadError> where
D: DeserializeOwned,
pub async fn load_many_ext<D>(
self: &Arc<Self>,
keys: impl Iterator<Item = PrimaryKey>,
allow_missing_keys: bool,
allow_serialization_error: bool
) -> Result<Vec<Dao<D>>, LoadError> where
D: DeserializeOwned,
pub fn session<'a>(&'a self) -> DioSessionGuard<'a>
pub fn session_mut<'a>(&'a self) -> DioSessionGuardMut<'a>
pub async fn wait_for_accurate_timing(&self)
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Dio
impl Send for Dio
impl Sync for Dio
impl Unpin for Dio
impl !UnwindSafe for Dio
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more