pub struct TxnServer { /* private fields */ }
Expand description
Server to keep track of the transactions currently active for this host.
Implementations§
Source§impl TxnServer
impl TxnServer
Sourcepub async fn new(workspace: DirLock<CacheBlock>) -> Self
pub async fn new(workspace: DirLock<CacheBlock>) -> Self
Construct a new TxnServer
.
Sourcepub fn new_txn<State>(
&self,
gateway: Arc<dyn Gateway<State = State>>,
txn_id: TxnId,
token: SignedToken,
) -> TCResult<Txn<State>>
pub fn new_txn<State>( &self, gateway: Arc<dyn Gateway<State = State>>, txn_id: TxnId, token: SignedToken, ) -> TCResult<Txn<State>>
Sourcepub async fn shutdown(self) -> TCResult<()>
pub async fn shutdown(self) -> TCResult<()>
Gracefully shut down this TxnServer
by allowing all active transactions to drain.
pub async fn finalize_expired<G>(&self, gateway: &G, now: NetworkTime)where
G: Gateway,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TxnServer
impl !RefUnwindSafe for TxnServer
impl Send for TxnServer
impl Sync for TxnServer
impl Unpin for TxnServer
impl !UnwindSafe for TxnServer
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§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<T> Pointable for T
impl<T> Pointable for 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
.