Skip to main content

Event

pub enum Event<'a> {
    PutRequest {
        source_file_name: FileId,
        destination_file_name: FileId,
        destination_id: EntityId,
        file_size: u64,
        checksum_type: ChecksumType,
    },
    PromptRequest {
        transaction_id: TransactionId,
        prompt_type: PromptType,
    },
    SuspendRequest {
        transaction_id: TransactionId,
    },
    ResumeRequest {
        transaction_id: TransactionId,
    },
    PduReceived {
        transaction_id: TransactionId,
        pdu: &'a Pdu,
    },
    TimerExpired {
        transaction_id: TransactionId,
        timer_type: TimerType,
    },
    DataSegmentReady {
        transaction_id: TransactionId,
        data: &'a [u8],
        offset: u64,
    },
    ChecksumReady {
        transaction_id: TransactionId,
        checksum: u32,
    },
}
Expand description

Represents all possible inputs that can drive the SenderMachine.

Variants§

§

PutRequest

A user request to send a file to a remote entity.

Fields

§source_file_name: FileId

Filestore identifier for the file on the sending side.

§destination_file_name: FileId

Filestore identifier for the file on the receiving side.

§destination_id: EntityId

The remote entity to send the file to.

§file_size: u64

Total size of the file being transferred in bytes.

§checksum_type: ChecksumType

Algorithm used to verify file integrity.

§

PromptRequest

A user request to prompt the receiver for a NAK or Keep Alive response.

Fields

§transaction_id: TransactionId

Identifies the transaction to send the prompt for.

§prompt_type: PromptType

Whether to prompt for a NAK or Keep Alive response.

§

SuspendRequest

A user request to suspend a transaction.

Fields

§transaction_id: TransactionId

Identifies the transaction to suspend.

§

ResumeRequest

A user request to resume a suspended transaction.

Fields

§transaction_id: TransactionId

Identifies the transaction to resume.

§

PduReceived

A PDU has been received from a remote entity for a transaction this machine is handling.

Fields

§transaction_id: TransactionId

Identifies the transaction the received PDU belongs to.

§pdu: &'a Pdu

The received protocol data unit to process.

§

TimerExpired

A timer, previously requested via an Action, has expired.

Fields

§transaction_id: TransactionId

Identifies the transaction the expired timer belongs to.

§timer_type: TimerType

The kind of timer that expired.

§

DataSegmentReady

A chunk of file data, requested via a RequestFileData action, is ready to be sent.

Fields

§transaction_id: TransactionId

Identifies the transaction the data belongs to.

§data: &'a [u8]

The file data segment payload.

§offset: u64

Byte offset within the file where this data begins.

§

ChecksumReady

The checksum calculation, requested via an Action, has completed.

Fields

§transaction_id: TransactionId

Identifies the transaction the checksum was computed for.

§checksum: u32

The computed checksum value.

Trait Implementations§

Source§

impl<'a> Debug for Event<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Event<'a>

§

impl<'a> RefUnwindSafe for Event<'a>

§

impl<'a> Send for Event<'a>

§

impl<'a> Sync for Event<'a>

§

impl<'a> Unpin for Event<'a>

§

impl<'a> UnsafeUnpin for Event<'a>

§

impl<'a> UnwindSafe for Event<'a>

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> Same for T

Source§

type Output = T

Should always be Self
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.