Enum netsvc_proto::tftp::TftpPacket
source · pub enum TftpPacket<B: ByteSlice> {
ReadRequest(RequestBody<B>),
WriteRequest(RequestBody<B>),
Data(DataBody<B>),
Ack(AckBody<B>),
Error(ErrorBody<B>),
OptionAck(OptionAckBody),
}
Expand description
A TFTP packet.
Implements [ParsablePacket
] to parse from wire representation.
Variants§
ReadRequest(RequestBody<B>)
WriteRequest(RequestBody<B>)
Data(DataBody<B>)
Ack(AckBody<B>)
Error(ErrorBody<B>)
OptionAck(OptionAckBody)
Implementations§
source§impl<B: ByteSlice> TftpPacket<B>
impl<B: ByteSlice> TftpPacket<B>
pub fn into_read_request(self) -> Result<RequestBody<B>, Self>
pub fn into_write_request(self) -> Result<RequestBody<B>, Self>
pub fn into_data(self) -> Result<DataBody<B>, Self>
pub fn into_ack(self) -> Result<AckBody<B>, Self>
pub fn into_error(self) -> Result<ErrorBody<B>, Self>
pub fn into_oack(self) -> Result<OptionAckBody, Self>
Trait Implementations§
source§impl<B: Debug + ByteSlice> Debug for TftpPacket<B>
impl<B: Debug + ByteSlice> Debug for TftpPacket<B>
source§impl<B> ParsablePacket<B, ()> for TftpPacket<B>where
B: ByteSlice,
impl<B> ParsablePacket<B, ()> for TftpPacket<B>where
B: ByteSlice,
§type Error = ParseError
type Error = ParseError
source§fn parse<BV: BufferView<B>>(buffer: BV, _args: ()) -> Result<Self, ParseError>
fn parse<BV: BufferView<B>>(buffer: BV, _args: ()) -> Result<Self, ParseError>
Parses a packet from a buffer. Read more
source§fn parse_metadata(&self) -> ParseMetadata
fn parse_metadata(&self) -> ParseMetadata
Gets metadata about this packet required by [
GrowBuffer::undo_parse
]. Read moreAuto Trait Implementations§
impl<B> Freeze for TftpPacket<B>
impl<B> RefUnwindSafe for TftpPacket<B>
impl<B> Send for TftpPacket<B>
impl<B> Sync for TftpPacket<B>
impl<B> Unpin for TftpPacket<B>
impl<B> UnwindSafe for TftpPacket<B>
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