Skip to main content

Action

pub enum Action<'a> {
Show 14 variants SendAck { transaction_id: TransactionId, destination_id: EntityId, directive_code: DirectiveCode, condition_code: ConditionCode, transaction_status: TransactionStatus, }, SendFinished { filestore_responses: Vec<FilestoreResponse, 4, u8>, transaction_id: TransactionId, destination_id: EntityId, condition_code: ConditionCode, }, SendNak { transaction_id: TransactionId, destination_id: EntityId, start_of_scope: u64, end_of_scope: u64, }, SendKeepAlive { transaction_id: TransactionId, destination_id: EntityId, progress: u64, }, WriteFileData { transaction_id: TransactionId, data: &'a [u8], offset: u64, }, StartTimer { transaction_id: TransactionId, seconds: u16, timer_type: TimerType, }, StopTimer { transaction_id: TransactionId, timer_type: Option<TimerType>, }, TerminateTransaction { transaction_id: TransactionId, condition_code: ConditionCode, }, NotifyFileReceived { transaction_id: TransactionId, file_size: u64, file_name: FileId, }, VerifyChecksum { transaction_id: TransactionId, expected_checksum: u32, checksum_type: ChecksumType, }, NotifyFault { transaction_id: TransactionId, condition_code: ConditionCode, }, NotifySuspended { transaction_id: TransactionId, }, NotifyResumed { transaction_id: TransactionId, progress: u64, }, ExecuteFilestoreRequests { requests: Vec<FilestoreRequest, 4, u8>, transaction_id: TransactionId, },
}
Expand description

Represents all possible outputs from the ReceiverMachine.

These are instructions for the Runner to execute.

Variants§

§

SendAck

Instructs the Runner to serialize and send an ACK PDU.

Fields

§transaction_id: TransactionId

The transaction this ACK belongs to.

§destination_id: EntityId

The remote entity to send the ACK to.

§directive_code: DirectiveCode

The directive being acknowledged.

§condition_code: ConditionCode

The condition under which this ACK is sent.

§transaction_status: TransactionStatus

The current status of the transaction.

§

SendFinished

Instructs the Runner to serialize and send a Finished PDU.

Fields

§filestore_responses: Vec<FilestoreResponse, 4, u8>

Responses from executed filestore requests.

§transaction_id: TransactionId

The transaction this Finished PDU belongs to.

§destination_id: EntityId

The remote entity to send the Finished PDU to.

§condition_code: ConditionCode

The condition under which the transaction finished.

§

SendNak

Instructs the Runner to serialize and send a NAK PDU.

Fields

§transaction_id: TransactionId

The transaction this NAK belongs to.

§destination_id: EntityId

The remote entity to send the NAK to.

§start_of_scope: u64

The beginning of the file scope covered by this NAK.

§end_of_scope: u64

The end of the file scope covered by this NAK.

§

SendKeepAlive

Instructs the Runner to serialize and send a Keep Alive PDU.

Fields

§transaction_id: TransactionId

The transaction this Keep Alive belongs to.

§destination_id: EntityId

The remote entity to send the Keep Alive to.

§progress: u64

The number of file data bytes received so far.

§

WriteFileData

Instructs the Runner to write a chunk of data to the filestore.

Fields

§transaction_id: TransactionId

The transaction this file data belongs to.

§data: &'a [u8]

The raw file data bytes to write.

§offset: u64

The byte offset within the file where the data should be written.

§

StartTimer

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

Fields

§transaction_id: TransactionId

The transaction this timer is associated with.

§seconds: u16

The duration of the timer in seconds.

§timer_type: TimerType

The kind of timer to start (e.g. ACK, NAK, inactivity).

§

StopTimer

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

Fields

§transaction_id: TransactionId

The transaction whose timer should be stopped.

§timer_type: Option<TimerType>

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

§

TerminateTransaction

Instructs the Runner to notify the user that a transaction has finished.

Fields

§transaction_id: TransactionId

The transaction being terminated.

§condition_code: ConditionCode

The condition that caused the termination.

§

NotifyFileReceived

Instructs the Runner to notify the user that a file has been successfully received.

Fields

§transaction_id: TransactionId

The unique ID of the completed transaction.

§file_size: u64

The total size of the received file in bytes.

§file_name: FileId

The final name of the received file.

§

VerifyChecksum

Instructs the Runner to verify the checksum of the received file.

Fields

§transaction_id: TransactionId

The transaction whose file checksum should be verified.

§expected_checksum: u32

The checksum value declared by the sender in the EOF PDU.

§checksum_type: ChecksumType

The algorithm used to compute the checksum.

§

NotifyFault

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

Fields

§transaction_id: TransactionId

The transaction in which the fault occurred.

§condition_code: ConditionCode

The condition code describing the fault.

§

NotifySuspended

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

Fields

§transaction_id: TransactionId

The transaction that was suspended.

§

NotifyResumed

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

Fields

§transaction_id: TransactionId

The transaction that was resumed.

§progress: u64

The number of file data bytes received at the time of resumption.

§

ExecuteFilestoreRequests

Instructs the Runner to execute filestore requests and report back with the results.

Fields

§requests: Vec<FilestoreRequest, 4, u8>

The filestore requests received in the Metadata PDU.

§transaction_id: TransactionId

The transaction these requests belong to.

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

impl<'a> PartialEq for Action<'a>

Source§

fn eq(&self, other: &Action<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Eq for Action<'a>

Source§

impl<'a> StructuralPartialEq for Action<'a>

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.