Skip to main content

JsonRpcProgram

Struct JsonRpcProgram 

Source
pub struct JsonRpcProgram<Program>(/* private fields */);
Expand description

Carries a typed JSON-RPC program during fluent composition.

Implementations§

Source§

impl<Program> JsonRpcProgram<Program>

Source

pub fn merge<Other>( self, other: JsonRpcProgram<Other>, ) -> JsonRpcProgram<Merge<Program, Other>>

Records the composition of two typed JSON-RPC programs.

Source

pub fn method<Handler, Params>( self, name: &'static str, operation: Operation<Handler, Params>, ) -> JsonRpcProgram<Merge<Program, Method<Handler, Params>>>

Registers a typed operation under a JSON-RPC method name.

Source

pub fn into_program(self) -> Program

Removes the fluent wrapper and returns the first-order syntax tree.

Trait Implementations§

Source§

impl<Program: Debug> Debug for JsonRpcProgram<Program>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Program> Freeze for JsonRpcProgram<Program>
where Program: Freeze,

§

impl<Program> RefUnwindSafe for JsonRpcProgram<Program>
where Program: RefUnwindSafe,

§

impl<Program> Send for JsonRpcProgram<Program>
where Program: Send,

§

impl<Program> Sync for JsonRpcProgram<Program>
where Program: Sync,

§

impl<Program> Unpin for JsonRpcProgram<Program>
where Program: Unpin,

§

impl<Program> UnsafeUnpin for JsonRpcProgram<Program>
where Program: UnsafeUnpin,

§

impl<Program> UnwindSafe for JsonRpcProgram<Program>
where Program: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<This> JsonRpcProgramExt<This> for This

Source§

fn compile_jsonrpc<Program>( &self, program: Program, ) -> <Program as JsonRpcProgramAlg<This>>::Methods
where Program: JsonRpcProgramAlg<This>,

Compiles a named JSON-RPC program with this interpreter.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.