pub struct Txn { /* private fields */ }
Implementations§
Source§impl Txn
impl Txn
pub const DEFAULT_MODE: Mode
Sourcepub fn grant(
&self,
actor: &Actor,
link: Link,
path: TCPathBuf,
mode: Mode,
) -> TCResult<Self>
pub fn grant( &self, actor: &Actor, link: Link, path: TCPathBuf, mode: Mode, ) -> TCResult<Self>
Grant mode
permissions on the resource at path
to the bearer of this Txn
’s token.
path
is relative to the cluster at link
whose actor
will sign the token.
Sourcepub fn mode<Keyring>(
&self,
_keyring: Keyring,
_resource: &[PathSegment],
) -> Mode
pub fn mode<Keyring>( &self, _keyring: Keyring, _resource: &[PathSegment], ) -> Mode
Get the set of permissions authorized by hosts in the keyring
for the given resource
.
pub fn locked_by(&self) -> TCResult<Option<VerifyingKey>>
pub fn claim(self, link: Link, actor: &Actor) -> TCResult<Self>
pub fn lock(self, actor: &Actor) -> TCResult<Self>
pub fn has_claims(&self) -> bool
pub fn leader( &self, path: &[PathSegment], ) -> TCResult<Option<(Link, VerifyingKey)>>
pub fn owner(&self) -> TCResult<Option<VerifyingKey>>
Trait Implementations§
Source§impl Gateway<State<Txn>> for Txn
impl Gateway<State<Txn>> for Txn
Source§fn get<'a, 'async_trait, L, V>(
&'a self,
link: L,
key: V,
) -> Pin<Box<dyn Future<Output = TCResult<State>> + Send + 'async_trait>>
fn get<'a, 'async_trait, L, V>( &'a self, link: L, key: V, ) -> Pin<Box<dyn Future<Output = TCResult<State>> + Send + 'async_trait>>
Resolve a GET op within this transaction context.
Source§fn put<'a, 'async_trait, L, K, V>(
&'a self,
link: L,
key: K,
value: V,
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>>
fn put<'a, 'async_trait, L, K, V>( &'a self, link: L, key: K, value: V, ) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>>
Resolve a PUT op within this transaction context.
Source§fn post<'a, 'async_trait, L, P>(
&'a self,
link: L,
params: P,
) -> Pin<Box<dyn Future<Output = TCResult<State>> + Send + 'async_trait>>
fn post<'a, 'async_trait, L, P>( &'a self, link: L, params: P, ) -> Pin<Box<dyn Future<Output = TCResult<State>> + Send + 'async_trait>>
Resolve a POST op within this transaction context.
Source§impl Transaction<CacheBlock> for Txn
impl Transaction<CacheBlock> for Txn
Source§fn context<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TCResult<DirLock<CacheBlock>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn context<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TCResult<DirLock<CacheBlock>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Allows locking the filesystem directory of this transaction context,
e.g. to cache un-committed state or to compute an intermediate result.
Source§fn subcontext<I: Into<Id> + Send>(&self, id: I) -> Self
fn subcontext<I: Into<Id> + Send>(&self, id: I) -> Self
Create a new transaction context with the given
id
.Source§fn subcontext_unique(&self) -> Self
fn subcontext_unique(&self) -> Self
Create a new transaction subcontext with its own unique workspace directory.
Auto Trait Implementations§
impl Freeze for Txn
impl !RefUnwindSafe for Txn
impl Send for Txn
impl Sync for Txn
impl Unpin for Txn
impl !UnwindSafe for Txn
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F> Match for F
impl<F> Match for F
Source§fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
Returns
true
if self
can be cast into the target type T
.Source§impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
Source§fn can_cast_from(_: &F) -> bool
fn can_cast_from(_: &F) -> bool
Test if
value
can be cast into Self
.Source§fn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns
Some(Self)
if the source value can be cast into Self
, otherwise None
.Source§impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
Source§fn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if
self
can be cast into T
.Source§fn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns
Some(T)
if self
can be cast into T
, otherwise None
.Source§fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
Returns
Ok(T)
if self
can be cast into T
, otherwise calls on_err
.