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

pub struct Txn { /* fields omitted */ }

A transaction context.


impl Txn[src]

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

Return the current number of strong references to this Txn.

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

Claim ownership of this transaction.

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

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<F, T> CastFrom<F> for T where
    T: From<F>, 

impl<T, F> CastInto<F> for T where
    F: CastFrom<T>, 

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

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

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

type Owned = T

The resulting type after obtaining ownership.

impl<F, T> TryCastFrom<F> for T where
    T: CastFrom<F>, 

impl<F, T> TryCastInto<T> for F where
    T: TryCastFrom<F>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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>,