OutgoingState

Enum OutgoingState 

Source
pub enum OutgoingState {
    Idle(bool),
    SendingCon(RetransmissionState, Duration),
    AwaitingResponse(Instant),
    SendingNon(RetransmissionState, bool, Duration),
    SendingPing(RetransmissionState, bool, Duration),
    SendingNotificationCon(RetransmissionState),
    SendingNotificationNon,
}
Expand description

Current state of an outgoing communication

Variants§

§

Idle(bool)

Ready to send a new request. The contained bool stores is the last communication attempt (if any) was successful. If so, the respective received response can be obtained with OutgoingCommunication::response.

§

SendingCon(RetransmissionState, Duration)

Sending a CON request and waiting for an ACK or piggybacked response. The additional Duration is used to start an application-level timeout to wait for a separate response if an ACK is received.

§

AwaitingResponse(Instant)

ACK received, waiting for separate response. The Instant is set to when we should time out, i.e. state entry plus the Duration from SendingCon.

§

SendingNon(RetransmissionState, bool, Duration)

Sending a NON request and waiting for a response. The RetransmissionState is used to limit the number of application-level (user-triggered) retransmissions. As a policy, we limit ourselves to the same exponential backoff strategy that is used for CON messages, i.e. if the user requests a retransmission but the last exponential backoff timeout has not yet expired, the retransmission will be delayed. If the next opportunity to (re)transmit shall be used is stored in the bool value. This is set to true automatically when schedule_non is called or when the user calls schedule_retransmission.

The additional Duration is used to trigger application-level timeouts based on the last (re)transmission instant.

§

SendingPing(RetransmissionState, bool, Duration)

Sending a ping and waiting for the associated RST message.

From the messaging layer perspective, this is identical to OutgoingState::SendingNon (waiting for a matching response without automatic retransmissions), its documentation applies here, too.

§

SendingNotificationCon(RetransmissionState)

Sending a CON notification and waiting for an ACK

§

SendingNotificationNon

Sending a NON notification

Trait Implementations§

Source§

impl Clone for OutgoingState

Source§

fn clone(&self) -> OutgoingState

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OutgoingState

Source§

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

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

impl Copy for OutgoingState

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.