pub enum Message {
    Sync(u32String),
    Metadata(u32Stringu32),
    ReceiveChunk(u32Stringu32Vec<u8>),
    ACK(u32String),
    NAK(u32StringOption<Vec<(u32, u32)>>),
    ReqReceive(u32StringStringOption<u32>),
    ReqTransmit(u32String),
    SuccessReceive(u32String),
    SuccessTransmit(u32Stringu32Option<u32>),
    Failure(u32String),
    Cleanup(u32Option<String>),
}
Expand description

File protocol message types

Variants

Sync(u32String)

TODO: Decide whether or not to keep this

Metadata(u32Stringu32)

Receiver should prepare a new temporary storage folder with the specified metadata

ReceiveChunk(u32Stringu32Vec<u8>)

File data chunk message

ACK(u32String)

Receiver has successfully gotten all data chunks of the requested file

NAK(u32StringOption<Vec<(u32, u32)>>)

Receiver is missing the specified file data chunks

ReqReceive(u32StringStringOption<u32>)

(Client Only) Message requesting the recipient to receive the specified file

ReqTransmit(u32String)

(Client Only) Message requesting the recipient to transmit the specified file

SuccessReceive(u32String)

(Server Only) Recipient has successfully processed a request to receive a file

SuccessTransmit(u32Stringu32Option<u32>)

(Server Only) Recipient has successfully prepared to transmit a file

Failure(u32String)

(Server Only) The transmit or receive request has failed to be completed

Cleanup(u32Option<String>)

Request Cleanup of either whole storage directory or individual file’s storage

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.