Struct onc_rpc::RpcMessage[][src]

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

An Open Network Computing RPC message, generic over a source of bytes (T) and a payload buffer (P`).

Implementations

Deserialises a new RpcMessage from buf.

Buf must contain exactly 1 message - if buf contains an incomplete message, or buf contains trailing bytes after the message IncompleteMessage is returned.

Construct a new RpcMessage with the specified transaction ID and message body.

Write this RpcMessage into buf, advancing the cursor to the end of the serialised message. buf must have capacity for at least serialised_len bytes from the current cursor position.

This method allows the caller to specify the underlying buffer used to hold the serialised message to enable reuse and pooling.

Serialise this RpcMessage into a new Vec.

The returned vec will be sized exactly to contain this message. Calling this method is the equivalent of:

let mut buf = Vec::with_capacity(msg.serialised_len() as usize);
let mut c = Cursor::new(buf);
msg.serialise_into(&mut c);

Returns the on-wire length of this message once serialised, including the message header.

The transaction ID for this request.

The MessageType contained in this request.

Returns the CallBody in this request, or None if this message is not a RPC call request.

Returns the ReplyBody in this request, or None if this message is not a RPC response.

Trait Implementations

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.