pub struct RpcList<FlowType> { /* private fields */ }Expand description
Binds typed RPC definitions to methods on one Flow type.
Return the completed list from crate::Flow::rpcs. Handler signatures encode whether input or
output is present, preventing invalid calls at compile time.
Implementations§
Source§impl<FlowType> RpcList<FlowType>
impl<FlowType> RpcList<FlowType>
Sourcepub fn function<Input, Output>(
self,
definition: impl Into<RpcDefinition<Input, Output>>,
handler: fn(&FlowType, &mut Context, Input) -> HandlerResult<RpcResult<Output>>,
) -> Self
pub fn function<Input, Output>( self, definition: impl Into<RpcDefinition<Input, Output>>, handler: fn(&FlowType, &mut Context, Input) -> HandlerResult<RpcResult<Output>>, ) -> Self
Binds an RPC that accepts typed input and returns typed output plus optional Step movements.
Handler errors are returned to Dex and follow RPC failure semantics.
Sourcepub fn function_without_input<Output>(
self,
definition: impl Into<RpcDefinition<(), Output>>,
handler: fn(&FlowType, &mut Context) -> HandlerResult<RpcResult<Output>>,
) -> Selfwhere
Output: Value,
pub fn function_without_input<Output>(
self,
definition: impl Into<RpcDefinition<(), Output>>,
handler: fn(&FlowType, &mut Context) -> HandlerResult<RpcResult<Output>>,
) -> Selfwhere
Output: Value,
Binds an RPC without input that returns typed output and optional Step movements.
Sourcepub fn procedure<Input>(
self,
definition: impl Into<RpcDefinition<Input, ()>>,
handler: fn(&FlowType, &mut Context, Input) -> HandlerResult<()>,
) -> Selfwhere
Input: Value,
pub fn procedure<Input>(
self,
definition: impl Into<RpcDefinition<Input, ()>>,
handler: fn(&FlowType, &mut Context, Input) -> HandlerResult<()>,
) -> Selfwhere
Input: Value,
Binds an RPC that accepts typed input and returns no output.
Sourcepub fn procedure_without_input(
self,
definition: impl Into<RpcDefinition<(), ()>>,
handler: fn(&FlowType, &mut Context) -> HandlerResult<()>,
) -> Self
pub fn procedure_without_input( self, definition: impl Into<RpcDefinition<(), ()>>, handler: fn(&FlowType, &mut Context) -> HandlerResult<()>, ) -> Self
Binds an RPC with neither input nor output.
Trait Implementations§
Auto Trait Implementations§
impl<FlowType> !RefUnwindSafe for RpcList<FlowType>
impl<FlowType> !UnwindSafe for RpcList<FlowType>
impl<FlowType> Forget for RpcList<FlowType>
impl<FlowType> Freeze for RpcList<FlowType>
impl<FlowType> Send for RpcList<FlowType>
impl<FlowType> Sync for RpcList<FlowType>
impl<FlowType> Unpin for RpcList<FlowType>
impl<FlowType> UnsafeUnpin for RpcList<FlowType>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request