Struct rpki_rtr::pdu::EndOfDataV0
source · [−]#[repr(packed)]pub struct EndOfDataV0 { /* private fields */ }
Expand description
End-of-data marks the end of sequence of payload PDUs.
This type is the version used in protocol version 0.
Implementations
sourceimpl EndOfDataV0
impl EndOfDataV0
sourceimpl EndOfDataV0
impl EndOfDataV0
sourceimpl EndOfDataV0
impl EndOfDataV0
sourcepub fn session(&self) -> u16
pub fn session(&self) -> u16
Returns the value of the session field of the header.
Note that this field is used for other purposes in some PDU types.
sourcepub fn size() -> u32
pub fn size() -> u32
Returns the PDU size.
The size is returned as a u32
since that type is used in
the header.
sourcepub async fn read<Sock: AsyncRead + Unpin>(
sock: &mut Sock
) -> Result<Self, Error>
pub async fn read<Sock: AsyncRead + Unpin>(
sock: &mut Sock
) -> Result<Self, Error>
Reads a value from a reader.
If a value with a different PDU type is received, returns an error.
sourcepub async fn try_read<Sock: AsyncRead + Unpin>(
sock: &mut Sock
) -> Result<Result<Self, Header>, Error>
pub async fn try_read<Sock: AsyncRead + Unpin>(
sock: &mut Sock
) -> Result<Result<Self, Header>, Error>
Tries to read a value from a reader.
If a different PDU type is received, returns the header as the error case of the ok case.
sourcepub async fn read_payload<Sock: AsyncRead + Unpin>(
header: Header,
sock: &mut Sock
) -> Result<Self, Error>
pub async fn read_payload<Sock: AsyncRead + Unpin>(
header: Header,
sock: &mut Sock
) -> Result<Self, Error>
Reads only the payload part of a value from a reader.
Assuming that the header was already read and is passed via
header
, the function reads the rest of the PUD from the
reader and returns the complete value.
Trait Implementations
sourceimpl AsMut<[u8]> for EndOfDataV0
impl AsMut<[u8]> for EndOfDataV0
sourceimpl AsRef<[u8]> for EndOfDataV0
impl AsRef<[u8]> for EndOfDataV0
sourceimpl Default for EndOfDataV0
impl Default for EndOfDataV0
sourcefn default() -> EndOfDataV0
fn default() -> EndOfDataV0
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for EndOfDataV0
impl Send for EndOfDataV0
impl Sync for EndOfDataV0
impl Unpin for EndOfDataV0
impl UnwindSafe for EndOfDataV0
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more