[][src]Struct onc_rpc::CallBody

pub struct CallBody<T, P> where
    T: AsRef<[u8]>, 
{ /* fields omitted */ }

A request invoking an RPC.

This structure is the Rust equivilent of the call_body structure defined in the RFC. The rpcvers field (representing the RPC protocol version) is hard coded to 2.

Implementations

impl<T, P> CallBody<T, P> where
    T: AsRef<[u8]>,
    P: AsRef<[u8]>, 
[src]

pub fn new(
    program: u32,
    program_version: u32,
    procedure: u32,
    auth_credentials: AuthFlavor<T>,
    auth_verifier: AuthFlavor<T>,
    payload: P
) -> Self
[src]

Construct a new RPC invocation request.

pub fn serialise_into(&self, buf: &mut Cursor<Vec<u8>>) -> Result<(), Error>[src]

Serialises this CallBody into buf, advancing the cursor position by serialised_len bytes.

pub fn serialised_len(&self) -> u32[src]

Returns the on-wire length of this call body once serialised.

pub fn rpc_version(&self) -> u32[src]

Returns the RPC version of this request.

This crate supports the ONC RPC version 2 only.

pub fn program(&self) -> u32[src]

Returns the program identifier in this request.

pub fn program_version(&self) -> u32[src]

The version of the program to be invoked.

pub fn procedure(&self) -> u32[src]

The program procedure number identifying the RPC to invoke.

pub fn auth_credentials(&self) -> &AuthFlavor<T>[src]

The credentials to use for authenticating the request.

pub fn auth_verifier(&self) -> &AuthFlavor<T>[src]

The verifier that should be used to validate the authentication credentials.

The RFC says the following about the verifier:

The purpose of the authentication verifier is to validate the
authentication credential.  Note that these two items are
historically separate, but are always used together as one logical
entity.

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

Returns a reference to the opaque message payload bytes.

Trait Implementations

impl<T: Debug, P: Debug> Debug for CallBody<T, P> where
    T: AsRef<[u8]>, 
[src]

impl<T: PartialEq, P: PartialEq> PartialEq<CallBody<T, P>> for CallBody<T, P> where
    T: AsRef<[u8]>, 
[src]

impl<T, P> StructuralPartialEq for CallBody<T, P> where
    T: AsRef<[u8]>, 
[src]

impl<'a> TryFrom<&'a [u8]> for CallBody<&'a [u8], &'a [u8]>[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Bytes> for CallBody<Bytes, Bytes>[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<T, P> RefUnwindSafe for CallBody<T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe
[src]

impl<T, P> Send for CallBody<T, P> where
    P: Send,
    T: Send
[src]

impl<T, P> Sync for CallBody<T, P> where
    P: Sync,
    T: Sync
[src]

impl<T, P> Unpin for CallBody<T, P> where
    P: Unpin,
    T: Unpin
[src]

impl<T, P> UnwindSafe for CallBody<T, P> where
    P: UnwindSafe,
    T: UnwindSafe
[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.