[][src]Enum tftp_server::packet::Packet

pub enum Packet {
    RRQ {
        filename: String,
        mode: String,
    },
    WRQ {
        filename: String,
        mode: String,
    },
    DATA {
        block_num: u16,
        data: DataBytes,
        len: usize,
    },
    ACK(u16),
    ERROR {
        code: ErrorCode,
        msg: String,
    },
}

Variants

RRQ

Fields of RRQ

filename: Stringmode: String
WRQ

Fields of WRQ

filename: Stringmode: String
DATA

Fields of DATA

block_num: u16data: DataByteslen: usize
ACK(u16)
ERROR

Fields of ERROR

code: ErrorCodemsg: String

Methods

impl Packet[src]

pub fn read(bytes: PacketData) -> Result<Packet>[src]

Creates and returns a packet parsed from its byte representation.

pub fn op_code(&self) -> OpCode[src]

Returns the packet's operation code.

pub fn bytes(self) -> Result<PacketData>[src]

Consumes the packet and returns the packet in byte representation.

Trait Implementations

impl Clone for Packet[src]

impl PartialEq<Packet> for Packet[src]

impl Debug for Packet[src]

impl StructuralPartialEq for Packet[src]

Auto Trait Implementations

impl Send for Packet

impl Sync for Packet

impl Unpin for Packet

impl UnwindSafe for Packet

impl RefUnwindSafe for Packet

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]