pub struct CallBody<T, P>{ /* private fields */ }
Expand description
A request invoking an RPC.
This structure is the Rust equivalent of the call_body
structure defined
in the RFC. The rpcvers
field (representing the RPC protocol version) is hard coded to 2
.
Implementations§
source§impl<T, P> CallBody<T, P>
impl<T, P> CallBody<T, P>
sourcepub fn new(
program: u32,
program_version: u32,
procedure: u32,
auth_credentials: AuthFlavor<T>,
auth_verifier: AuthFlavor<T>,
payload: P
) -> Self
pub fn new( program: u32, program_version: u32, procedure: u32, auth_credentials: AuthFlavor<T>, auth_verifier: AuthFlavor<T>, payload: P ) -> Self
Construct a new RPC invocation request.
sourcepub fn serialise_into<W: Write>(&self, buf: W) -> Result<(), Error>
pub fn serialise_into<W: Write>(&self, buf: W) -> Result<(), Error>
Serialises this CallBody
into buf
, advancing the cursor position by
CallBody::serialised_len()
bytes.
sourcepub fn serialised_len(&self) -> u32
pub fn serialised_len(&self) -> u32
Returns the on-wire length of this call body once serialised.
sourcepub fn rpc_version(&self) -> u32
pub fn rpc_version(&self) -> u32
Returns the RPC version of this request.
This crate supports the ONC RPC version 2 only.
sourcepub fn program_version(&self) -> u32
pub fn program_version(&self) -> u32
The version of the program to be invoked.
sourcepub fn auth_credentials(&self) -> &AuthFlavor<T>
pub fn auth_credentials(&self) -> &AuthFlavor<T>
The credentials to use for authenticating the request.
sourcepub fn auth_verifier(&self) -> &AuthFlavor<T>
pub fn auth_verifier(&self) -> &AuthFlavor<T>
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.
Trait Implementations§
source§impl<T, P: PartialEq> PartialEq for CallBody<T, P>
impl<T, P: PartialEq> PartialEq for CallBody<T, P>
impl<T, P> StructuralPartialEq for CallBody<T, P>
Auto Trait Implementations§
impl<T, P> Freeze for CallBody<T, P>
impl<T, P> RefUnwindSafe for CallBody<T, P>where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, P> Send for CallBody<T, P>
impl<T, P> Sync for CallBody<T, P>
impl<T, P> Unpin for CallBody<T, P>
impl<T, P> UnwindSafe for CallBody<T, P>where
P: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more