Struct onc_rpc::RpcMessage [−][src]
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 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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<T, P> RefUnwindSafe for RpcMessage<T, P> where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, P> Send for RpcMessage<T, P> where
P: Send,
T: Send,
impl<T, P> Sync for RpcMessage<T, P> where
P: Sync,
T: Sync,
impl<T, P> Unpin for RpcMessage<T, P> where
P: Unpin,
T: Unpin,
impl<T, P> UnwindSafe for RpcMessage<T, P> where
P: UnwindSafe,
T: UnwindSafe,