pub struct Operation<Handler, Params = Positional> { /* private fields */ }Expand description
Carries a typed operation declaration as first-order data.
Implementations§
Source§impl<Handler, Params> Operation<Handler, Params>
impl<Handler, Params> Operation<Handler, Params>
Sourcepub fn declare(self, name: &'static str) -> Method<Handler, Params>
pub fn declare(self, name: &'static str) -> Method<Handler, Params>
Declares this operation under one method name, with no program around it.
A program that states many methods composes their registrations rather than their types, so
it needs each method on its own. JsonRpcProgram::method states the same thing inside a
composition, and is what an author writes.
Source§impl<Handler> Operation<Handler, Positional>
impl<Handler> Operation<Handler, Positional>
Sourcepub fn positional(self) -> Self
pub fn positional(self) -> Self
Selects positional parameter decoding for this operation declaration.
Positional decoding is already the default, so this modifier is useful when a declaration benefits from making the wire shape explicit.
Sourcepub fn named(self) -> Operation<Handler, NamedParams>
pub fn named(self) -> Operation<Handler, NamedParams>
Selects named parameter decoding using the defunctionalized operation’s source argument names.
Sourcepub fn fallible(self) -> Operation<Handler, FalliblePositional>
pub fn fallible(self) -> Operation<Handler, FalliblePositional>
Converts the operation’s error into a JSON-RPC protocol error.
Source§impl<Handler> Operation<Handler, NamedParams>
impl<Handler> Operation<Handler, NamedParams>
Sourcepub fn fallible(self) -> Operation<Handler, FallibleNamed>
pub fn fallible(self) -> Operation<Handler, FallibleNamed>
Converts the operation’s error into a JSON-RPC protocol error.
Source§impl<Handler> Operation<Handler, FalliblePositional>
impl<Handler> Operation<Handler, FalliblePositional>
Sourcepub fn named(self) -> Operation<Handler, FallibleNamed>
pub fn named(self) -> Operation<Handler, FallibleNamed>
Selects named parameter decoding, keeping the failure mode.
Trait Implementations§
Auto Trait Implementations§
impl<Handler, Params> Freeze for Operation<Handler, Params>
impl<Handler, Params> RefUnwindSafe for Operation<Handler, Params>
impl<Handler, Params> Send for Operation<Handler, Params>
impl<Handler, Params> Sync for Operation<Handler, Params>
impl<Handler, Params> Unpin for Operation<Handler, Params>
impl<Handler, Params> UnsafeUnpin for Operation<Handler, Params>
impl<Handler, Params> UnwindSafe for Operation<Handler, Params>
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
Source§impl<This> JsonRpcProgramExt<This> for This
impl<This> JsonRpcProgramExt<This> for This
Source§fn compile_jsonrpc<Program>(
&self,
program: Program,
) -> <Program as JsonRpcProgramAlg<This>>::Methodswhere
Program: JsonRpcProgramAlg<This>,
fn compile_jsonrpc<Program>(
&self,
program: Program,
) -> <Program as JsonRpcProgramAlg<This>>::Methodswhere
Program: JsonRpcProgramAlg<This>,
Compiles a named JSON-RPC program with this interpreter.