[][src]Struct no_proto::rpc::NP_RPC_Factory

pub struct NP_RPC_Factory<'fact> { /* fields omitted */ }

RPC Factory

Implementations

impl<'fact> NP_RPC_Factory<'fact>[src]

pub fn new(json_rcp_spec: &str) -> Result<Self, NP_Error>[src]

Parse a JSON RPC spec into an RPC Factory

pub fn get_name(&self) -> &str[src]

Get API name

pub fn get_author(&self) -> &str[src]

Get API author

pub fn get_id(&self) -> String[src]

Get API ID

pub fn get_version(&self) -> String[src]

Get API Version

pub fn new_compiled(bytes_rpc_spec: &'fact [u8]) -> Result<Self, NP_Error>[src]

Parse a byte rpc spec into an RPC Factory.

This method is orders of magnitude faster than the new method since there's no JSON to parse and only a few memory allocations.

pub fn compile_spec(&self) -> &[u8][src]

Get a copy of the compiled byte array specification

The compiled byte array is much faster to parse and takes up much less space.

If you don't need the verbosity of the JSON spec, use this instead.

pub fn new_request(
    &self,
    rpc_name: &str
) -> Result<NP_RPC_Request<'_>, NP_Error>
[src]

Generate a new request object for a given rpc function

pub fn open_request(
    &self,
    bytes: Vec<u8>
) -> Result<NP_RPC_Request<'_>, NP_Error>
[src]

Open a request. The request spec and version must match the current spec and version of this factory.

pub fn new_response(
    &self,
    rpc_name: &str
) -> Result<NP_RPC_Response<'_>, NP_Error>
[src]

Generate a new response object for a given rpc function

pub fn open_response(
    &self,
    bytes: Vec<u8>
) -> Result<NP_RPC_Response<'_>, NP_Error>
[src]

Open a response. The response spec and version must match the current spec and version of this factory.

Trait Implementations

impl<'fact> Debug for NP_RPC_Factory<'fact>[src]

Auto Trait Implementations

impl<'fact> Send for NP_RPC_Factory<'fact>[src]

impl<'fact> Sync for NP_RPC_Factory<'fact>[src]

impl<'fact> Unpin for NP_RPC_Factory<'fact>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.