Enum Message

Source
pub enum Message<'b> {
    File {
        operation: FileOperation,
        path: &'b AsciiStr,
        mode: Mode,
    },
    Data(BlockId, BufAtMost512<'b>),
    Ack(BlockId),
    Error(BlockId, &'b AsciiStr),
}
Expand description

A single TFTP message.

Variants§

§

File

File operation message.

By protocol definition, this is the first message of TFTP session.

Fields

§operation: FileOperation

Exact file operation client requested.

§path: &'b AsciiStr

A path of file server should work with (write to it or read it).

§mode: Mode

Data sending mode that client requested

§

Data(BlockId, BufAtMost512<'b>)

A block of data (max 512 bytes in len).

§

Ack(BlockId)

Acknowledge of receiving a block of data.

§

Error(BlockId, &'b AsciiStr)

Error happened during TFTP session.

Trait Implementations§

Source§

impl<'b> Debug for Message<'b>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'b> From<Message<'b>> for Vec<u8>

Source§

fn from(message: Message<'b>) -> Self

Converts to this type from the input type.
Source§

impl<'b> TryFrom<&'b [u8]> for Message<'b>

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(buf: &'b [u8]) -> Result<Self, Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'b> Freeze for Message<'b>

§

impl<'b> RefUnwindSafe for Message<'b>

§

impl<'b> Send for Message<'b>

§

impl<'b> Sync for Message<'b>

§

impl<'b> Unpin for Message<'b>

§

impl<'b> UnwindSafe for Message<'b>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.