pub enum EndOfData {
V0(EndOfDataV0),
V1(EndOfDataV1),
}
Expand description
End-of-data marks the end of sequence of payload PDUs.
This PDU differs between version 0 and 1 of RTR. Consequently, this generic version is an enum that can be both, depending on the version requested.
Variants
V0(EndOfDataV0)
V1(EndOfDataV1)
Implementations
sourceimpl EndOfData
impl EndOfData
sourcepub fn new(version: u8, state: State, timing: Timing) -> Self
pub fn new(version: u8, state: State, timing: Timing) -> Self
Creates a new end-of-data PDU from the data given.
If version is 0, the V0
variant is created and the three timer
values are ignored. Otherwise, a V1
variant is created with the
given version.
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 the end-of-data payload from a reader.
Which version of the end-of-data PDU is expected depends on the
version field of the header
. On success, the return value contains
a full PDU, filling in missing data from header
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for EndOfData
impl Send for EndOfData
impl Sync for EndOfData
impl Unpin for EndOfData
impl UnwindSafe for EndOfData
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