pub struct Closure<Txn> { /* private fields */ }
Implementations§
Source§impl<Txn> Closure<Txn>
impl<Txn> Closure<Txn>
Sourcepub fn dereference_self(self, path: &TCPathBuf) -> Self
pub fn dereference_self(self, path: &TCPathBuf) -> Self
Replace references to $self
with the given path
.
Sourcepub fn is_inter_service_write(&self, cluster_path: &[PathSegment]) -> bool
pub fn is_inter_service_write(&self, cluster_path: &[PathSegment]) -> bool
Return true
if this Closure
may write to service other than where it’s defined
Sourcepub fn reference_self(self, path: &TCPathBuf) -> Self
pub fn reference_self(self, path: &TCPathBuf) -> Self
Replace references to the given path
with $self
Sourcepub async fn call(self, txn: &Txn, args: State<Txn>) -> TCResult<State<Txn>>
pub async fn call(self, txn: &Txn, args: State<Txn>) -> TCResult<State<Txn>>
Execute this Closure
with the given args
Sourcepub async fn call_owned(
self,
txn: Txn,
args: State<Txn>,
) -> TCResult<State<Txn>>
pub async fn call_owned( self, txn: Txn, args: State<Txn>, ) -> TCResult<State<Txn>>
Execute this Closure
with an owned txn
and the given args
.
Trait Implementations§
Source§impl<Txn> ClosureInstance<State<Txn>> for Closure<Txn>
impl<Txn> ClosureInstance<State<Txn>> for Closure<Txn>
Source§impl<Txn> FromStream for Closure<Txn>
impl<Txn> FromStream for Closure<Txn>
Source§impl<'a, Txn> Handler<'a, State<Txn>> for Closure<Txn>
impl<'a, Txn> Handler<'a, State<Txn>> for Closure<Txn>
fn get<'b>(self: Box<Self>) -> Option<GetHandler<'a, 'b, Txn, State<Txn>>>where
'b: 'a,
fn put<'b>(self: Box<Self>) -> Option<PutHandler<'a, 'b, Txn, State<Txn>>>where
'b: 'a,
fn post<'b>(self: Box<Self>) -> Option<PostHandler<'a, 'b, Txn, State<Txn>>>where
'b: 'a,
fn delete<'b>(self: Box<Self>) -> Option<DeleteHandler<'a, 'b, Txn>>where
'b: 'a,
Source§impl<'en, Txn> IntoView<'en, CacheBlock> for Closure<Txn>
impl<'en, Txn> IntoView<'en, CacheBlock> for Closure<Txn>
Source§impl<Txn> TryCastFrom<Scalar> for Closure<Txn>
impl<Txn> TryCastFrom<Scalar> for Closure<Txn>
Source§fn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if
value
can be cast into Self
.Source§fn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns
Some(Self)
if the source value can be cast into Self
, otherwise None
.Source§impl<Txn> TryCastFrom<State<Txn>> for Closure<Txn>
impl<Txn> TryCastFrom<State<Txn>> for Closure<Txn>
Source§fn can_cast_from(state: &State<Txn>) -> bool
fn can_cast_from(state: &State<Txn>) -> bool
Test if
value
can be cast into Self
.Source§fn opt_cast_from(state: State<Txn>) -> Option<Self>
fn opt_cast_from(state: State<Txn>) -> Option<Self>
Returns
Some(Self)
if the source value can be cast into Self
, otherwise None
.Auto Trait Implementations§
impl<Txn> Freeze for Closure<Txn>
impl<Txn> RefUnwindSafe for Closure<Txn>where
Txn: RefUnwindSafe,
impl<Txn> Send for Closure<Txn>where
Txn: Send,
impl<Txn> Sync for Closure<Txn>where
Txn: Sync,
impl<Txn> Unpin for Closure<Txn>
impl<Txn> UnwindSafe for Closure<Txn>where
Txn: RefUnwindSafe,
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
.