Struct tinychain::txn::Txn[][src]

pub struct Txn { /* fields omitted */ }

A transaction context.

Implementations

impl Txn[src]

pub fn ref_count(&self) -> usize[src]

Return the current number of strong references to this Txn.

pub async fn claim(
    self,
    actor: &Actor,
    cluster_path: TCPathBuf
) -> TCResult<Self>
[src]

Claim ownership of this transaction.

pub async fn grant(
    &self,
    actor: &Actor,
    cluster_path: TCPathBuf,
    scopes: Vec<Scope>
) -> TCResult<Self>
[src]

pub fn is_owner(&self, cluster_path: &[PathSegment]) -> bool[src]

Check if the cluster at the specified path on this host is the owner of the transaction.

pub fn owner(&self) -> Option<&Link>[src]

Return the owner of this transaction, if there is one.

Return a link to the given path on this host.

pub fn request(&self) -> &Request[src]

Return the Request which initiated this transaction on this host.

pub async fn get(&self, link: Link, key: Value) -> TCResult<State>[src]

Resolve a GET op within this transaction context.

pub async fn put(&self, link: Link, key: Value, value: State) -> TCResult<()>[src]

Resolve a PUT op within this transaction context.

pub async fn post(&self, link: Link, params: State) -> TCResult<State>[src]

Resolve a POST op within this transaction context.

pub async fn delete(&self, link: Link, key: Value) -> TCResult<()>[src]

Resolve a DELETE op within this transaction context.

Trait Implementations

impl Clone for Txn[src]

impl Hash for Txn[src]

Auto Trait Implementations

impl !RefUnwindSafe for Txn

impl Send for Txn

impl Sync for Txn

impl Unpin for Txn

impl !UnwindSafe for Txn

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<F, T> CastFrom<F> for T where
    T: From<F>, 
[src]

impl<T, F> CastInto<F> for T where
    F: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F> Match for F[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<F, T> TryCastFrom<F> for T where
    T: CastFrom<F>, 
[src]

impl<F, T> TryCastInto<T> for F where
    T: TryCastFrom<F>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,