[−][src]Struct no_proto::rpc::NP_RPC_Factory
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]
&self,
rpc_name: &str
) -> Result<NP_RPC_Request<'_>, NP_Error>
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]
&self,
bytes: Vec<u8>
) -> Result<NP_RPC_Request<'_>, NP_Error>
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]
&self,
rpc_name: &str
) -> Result<NP_RPC_Response<'_>, NP_Error>
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]
&self,
bytes: Vec<u8>
) -> Result<NP_RPC_Response<'_>, NP_Error>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,