pub struct Gateway { /* private fields */ }
Expand description
Responsible for handling inbound and outbound traffic over the network.
Implementations§
source§impl Gateway
impl Gateway
sourcepub fn time() -> NetworkTime
pub fn time() -> NetworkTime
Return the current timestamp.
sourcepub fn new(config: Config, kernel: Kernel, txn_server: TxnServer) -> Self
pub fn new(config: Config, kernel: Kernel, txn_server: TxnServer) -> Self
Initialize a new Gateway
sourcepub fn request_ttl(&self) -> Duration
pub fn request_ttl(&self) -> Duration
Return the configured maximum request time-to-live (timeout duration).
sourcepub fn new_token(&self, txn_id: &TxnId) -> TCResult<SignedToken>
pub fn new_token(&self, txn_id: &TxnId) -> TCResult<SignedToken>
Return a new, signed auth token with no claims.
Trait Implementations§
source§impl Gateway for Gateway
impl Gateway for Gateway
type State = State
source§fn fetch<'a>(
&'a self,
txn_id: &'a TxnId,
link: ToUrl<'a>,
key: &'a Value
) -> TCBoxTryFuture<'_, Value>
fn fetch<'a>( &'a self, txn_id: &'a TxnId, link: ToUrl<'a>, key: &'a Value ) -> TCBoxTryFuture<'_, Value>
Read a simple value.
source§fn get<'a>(
&'a self,
txn: &'a Txn,
link: ToUrl<'a>,
key: Value
) -> TCBoxTryFuture<'a, State>
fn get<'a>( &'a self, txn: &'a Txn, link: ToUrl<'a>, key: Value ) -> TCBoxTryFuture<'a, State>
Read the [
State
] at link
with the given key
.source§fn put<'a>(
&'a self,
txn: &'a Txn,
link: ToUrl<'a>,
key: Value,
value: State
) -> TCBoxTryFuture<'a, ()>
fn put<'a>( &'a self, txn: &'a Txn, link: ToUrl<'a>, key: Value, value: State ) -> TCBoxTryFuture<'a, ()>
Update the [
State
] with the given key
at link
to value
.source§fn post<'a>(
&'a self,
txn: &'a Txn,
link: ToUrl<'a>,
params: State
) -> TCBoxTryFuture<'a, State>
fn post<'a>( &'a self, txn: &'a Txn, link: ToUrl<'a>, params: State ) -> TCBoxTryFuture<'a, State>
Execute the POST op at
link
with the params
source§fn delete<'a>(
&'a self,
txn: &'a Txn,
link: ToUrl<'a>,
key: Value
) -> TCBoxTryFuture<'a, ()>
fn delete<'a>( &'a self, txn: &'a Txn, link: ToUrl<'a>, key: Value ) -> TCBoxTryFuture<'a, ()>
Delete the [
State
] at link
with the given key
.fn finalize(&self, txn_id: TxnId) -> TCBoxFuture<'_, ()>
Auto Trait Implementations§
impl !RefUnwindSafe for Gateway
impl Send for Gateway
impl Sync for Gateway
impl Unpin for Gateway
impl !UnwindSafe for Gateway
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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
.§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
.