pub struct ProcedureSurrogate<P> { /* private fields */ }Available on crate feature
router only.Expand description
A procedure captured by a runtime expression.
Serializes the endpoint URL for the browser and checks the argument and
return types of call.
Implementations§
Source§impl<P: TypedProcedure> ProcedureSurrogate<P>
impl<P: TypedProcedure> ProcedureSurrogate<P>
Sourcepub const fn new(procedure: P, url: &'static str) -> Self
pub const fn new(procedure: P, url: &'static str) -> Self
Pairs a procedure with the URL that serves its calls.
Sourcepub async fn call(
&self,
_args: <P::Args as Surrogated>::Surrogate,
) -> <P::Output as Surrogated>::Surrogate
pub async fn call( &self, _args: <P::Args as Surrogated>::Surrogate, ) -> <P::Output as Surrogated>::Surrogate
Invokes the procedure from the client side.
§Panics
Always panics; procedures can only be invoked from the client runtime.
Trait Implementations§
Source§impl<P: TypedProcedure> Serialize for ProcedureSurrogate<P>
impl<P: TypedProcedure> Serialize for ProcedureSurrogate<P>
Source§impl<P> Surrogate for &'static ProcedureSurrogate<P>
impl<P> Surrogate for &'static ProcedureSurrogate<P>
Auto Trait Implementations§
impl<P> Freeze for ProcedureSurrogate<P>where
P: Freeze,
impl<P> RefUnwindSafe for ProcedureSurrogate<P>where
P: RefUnwindSafe,
impl<P> Send for ProcedureSurrogate<P>where
P: Send,
impl<P> Sync for ProcedureSurrogate<P>where
P: Sync,
impl<P> Unpin for ProcedureSurrogate<P>where
P: Unpin,
impl<P> UnsafeUnpin for ProcedureSurrogate<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for ProcedureSurrogate<P>where
P: UnwindSafe,
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