Struct ate::prelude::Chain [−][src]
pub struct Chain { /* fields omitted */ }Expand description
Represents the main API to access a specific chain-of-trust
This object must stay within scope for the duration of its use which has been optimized for infrequent initialization as creating this object will reload the entire chain’s metadata into memory.
The actual data of the chain is stored locally on disk thus huge chains can be stored here however very random access on large chains will result in random access IO on the disk.
Chains also allow subscribe/publish models to be applied to particular vectors (see the examples for details)
Implementations
Opens a data access layer that allows mutable changes to data. Transaction consistency on commit will be guarranted for local redo log files
Opens a data access layer that allows mutable changes to data (in a fire-and-forget mode). No transaction consistency on commits will be enforced
Opens a data access layer that allows mutable changes to data. Transaction consistency on commit will be guarranted for all remote replicas
pub async fn dio_trans(
self: &Arc<Chain>,
session: &dyn AteSession,
scope: TransactionScope
) -> Arc<DioMut>
pub async fn dio_trans(
self: &Arc<Chain>,
session: &dyn AteSession,
scope: TransactionScope
) -> Arc<DioMut>
Opens a data access layer that allows mutable changes to data. Transaction consistency on commit must be specified
pub async fn invoke<REQ, RES, ERR>(
self: Arc<Self>,
request: REQ
) -> Result<Result<RES, ERR>, InvokeError> where
REQ: Clone + Serialize + DeserializeOwned + Sync + Send + ?Sized,
RES: Serialize + DeserializeOwned + Sync + Send + ?Sized,
ERR: Serialize + DeserializeOwned + Sync + Send + ?Sized,
pub async fn invoke_ext<REQ, RES, ERR>(
self: Arc<Self>,
session: Option<&dyn AteSession>,
request: REQ,
timeout: Duration
) -> Result<Result<RES, ERR>, InvokeError> where
REQ: Clone + Serialize + DeserializeOwned + Sync + Send + ?Sized,
RES: Serialize + DeserializeOwned + Sync + Send + ?Sized,
ERR: Serialize + DeserializeOwned + Sync + Send + ?Sized,
pub fn add_service<CTX, REQ, RES, ERR, C, F>(
self: &Arc<Self>,
session: &dyn AteSession,
context: Arc<CTX>,
callback: C
) -> Arc<ServiceHook> where
CTX: Send + Sync + 'static,
REQ: DeserializeOwned + Send + Sync + Sized + 'static,
RES: Serialize + Send + Sync + Sized + 'static,
ERR: Serialize + Send + Sync + Sized + 'static,
C: Fn(Arc<CTX>, REQ) -> F + Send + 'static,
F: Future<Output = Result<RES, ERR>> + Send + 'static,
pub fn add_generic_service(
self: &Arc<Self>,
session: Box<dyn AteSession>,
handler: &Arc<dyn ServiceInvoker>
) -> Arc<ServiceHook>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Chain
impl !UnwindSafe for Chain
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
