Skip to main content

Action

Enum Action 

Source
pub enum Action<'a> {
Show 15 variants SendMetadata { transaction_id: TransactionId, destination_id: EntityId, file_size: u64, source_file_name: FileId, destination_file_name: FileId, checksum_type: ChecksumType, }, SendFileData { transaction_id: TransactionId, destination_id: EntityId, offset: u64, data: &'a [u8], }, SendEof { transaction_id: TransactionId, destination_id: EntityId, condition_code: ConditionCode, file_size: u64, checksum: u32, }, SendFinished { transaction_id: TransactionId, destination_id: EntityId, condition_code: ConditionCode, }, SendAck { transaction_id: TransactionId, destination_id: EntityId, acked_directive_code: AckedDirectiveCode, condition_code: ConditionCode, transaction_status: TransactionStatus, }, SendPrompt { transaction_id: TransactionId, destination_id: EntityId, prompt_type: PromptType, }, ReadDataSegment { transaction_id: TransactionId, start_offset: u64, end_offset: u64, }, ReadDataSegmentBatch { transaction_id: TransactionId, segments: NakSegmentsIterator<'a>, }, StartTimer { transaction_id: TransactionId, timer_type: TimerType, seconds: u16, }, StopTimer { transaction_id: TransactionId, timer_type: Option<TimerType>, }, TerminateTransaction { transaction_id: TransactionId, condition_code: ConditionCode, }, CalculateChecksum { transaction_id: TransactionId, checksum_type: ChecksumType, }, NotifyFault { transaction_id: TransactionId, condition_code: ConditionCode, }, NotifySuspended { transaction_id: TransactionId, }, NotifyResumed { transaction_id: TransactionId, progress: u64, },
}
Expand description

Represents all possible outputs from the SenderMachine.

These are instructions for the Runner to execute, such as sending PDUs, managing timers, or interacting with the filestore.

Variants§

§

SendMetadata

Instructs the Runner to serialize and send a Metadata PDU.

Fields

§transaction_id: TransactionId

Identifies the transaction this PDU belongs to.

§destination_id: EntityId

The remote entity to send this PDU to.

§file_size: u64

Total size of the file being transferred in bytes.

§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.

§checksum_type: ChecksumType

Algorithm used to verify file integrity.

§

SendFileData

Instructs the Runner to serialize and send a File Data PDU.

Fields

§transaction_id: TransactionId

Identifies the transaction this PDU belongs to.

§destination_id: EntityId

The remote entity to send this PDU to.

§offset: u64

Byte offset within the file where this data begins.

§data: &'a [u8]

The file data segment payload.

§

SendEof

Instructs the Runner to serialize and send an EOF PDU.

Fields

§transaction_id: TransactionId

Identifies the transaction this PDU belongs to.

§destination_id: EntityId

The remote entity to send this PDU to.

§condition_code: ConditionCode

Status condition at the time the EOF is sent.

§file_size: u64

Total size of the file in bytes.

§checksum: u32

Computed checksum of the complete file data.

§

SendFinished

Instructs the Runner to serialize and send a Finished PDU.

Fields

§transaction_id: TransactionId

Identifies the transaction this PDU belongs to.

§destination_id: EntityId

The remote entity to send this PDU to.

§condition_code: ConditionCode

Final status condition of the transaction.

§

SendAck

Instructs the Runner to serialize and send an ACK PDU.

Fields

§transaction_id: TransactionId

Identifies the transaction this PDU belongs to.

§destination_id: EntityId

The remote entity to send this PDU to.

§acked_directive_code: AckedDirectiveCode

The directive code being acknowledged.

§condition_code: ConditionCode

Status condition associated with the acknowledgment.

§transaction_status: TransactionStatus

Current status of the transaction being acknowledged.

§

SendPrompt

Instructs the Runner to serialize and send a Prompt PDU.

Fields

§transaction_id: TransactionId

Identifies the transaction this PDU belongs to.

§destination_id: EntityId

The remote entity to send this PDU to.

§prompt_type: PromptType

Whether to prompt for a NAK or Keep Alive response.

§

ReadDataSegment

Instructs the Runner to read a segment of data from the filestore.

Fields

§transaction_id: TransactionId

Identifies the transaction this read belongs to.

§start_offset: u64

Byte offset where the segment begins.

§end_offset: u64

Byte offset where the segment ends (exclusive).

§

ReadDataSegmentBatch

Instructs the Runner to read multiple segments of data from the filestore.

Fields

§transaction_id: TransactionId

Identifies the transaction this batch read belongs to.

§segments: NakSegmentsIterator<'a>

Iterator over the missing segments requested by the receiver.

§

StartTimer

Instructs the Runner to start a timer for a specific transaction.

Fields

§transaction_id: TransactionId

Identifies the transaction this timer belongs to.

§timer_type: TimerType

The kind of timer to start (e.g. Ack, Nak, Inactivity).

§seconds: u16

Duration of the timer in seconds.

§

StopTimer

Instructs the Runner to stop a timer for a specific transaction.

Fields

§transaction_id: TransactionId

Identifies the transaction this timer belongs to.

§timer_type: Option<TimerType>

The type of timer to stop. If None, stops all timers for the transaction.

§

TerminateTransaction

Instructs the Runner that a transaction is completed and can be cleaned up.

Fields

§transaction_id: TransactionId

Identifies the transaction to terminate.

§condition_code: ConditionCode

Final status condition describing why the transaction ended.

§

CalculateChecksum

Instructs the Runner to calculate a checksum for a transaction.

Fields

§transaction_id: TransactionId

Identifies the transaction to compute the checksum for.

§checksum_type: ChecksumType

Algorithm to use for the checksum calculation.

§

NotifyFault

Instructs the Runner to notify the user that a fault has occurred.

Fields

§transaction_id: TransactionId

Identifies the faulted transaction.

§condition_code: ConditionCode

The condition that caused the fault.

§

NotifySuspended

Instructs the Runner to notify the user that a transaction was suspended.

Fields

§transaction_id: TransactionId

Identifies the suspended transaction.

§

NotifyResumed

Instructs the Runner to notify the user that a transaction was resumed.

Fields

§transaction_id: TransactionId

Identifies the resumed transaction.

§progress: u64

Number of bytes successfully transferred before suspension.

Trait Implementations§

Source§

impl<'a> Debug for Action<'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 Action<'a>

§

impl<'a> RefUnwindSafe for Action<'a>

§

impl<'a> Send for Action<'a>

§

impl<'a> Sync for Action<'a>

§

impl<'a> Unpin for Action<'a>

§

impl<'a> UnsafeUnpin for Action<'a>

§

impl<'a> UnwindSafe for Action<'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.