OutgoingEvent

Enum OutgoingEvent 

Source
pub enum OutgoingEvent<'a> {
Show 14 variants Nothing, SendCon, SendNon, SendPing, AckReceived, Success(EncodedMessage<'a>), Timeout, PiggybackedWrongToken, ResetReceived, DuplicatedResponse, SendNotification, NotificationAck, NotificationRst(Token), NotificationTimeout,
}
Expand description

What has happened in the OutgoingCommunication path when calling CoapEndpoint::process

This type is annotated with must_use because some events require user interaction to avoid getting stuck in specific states. See the documentation for the specific events for more information.

Variants§

§

Nothing

No real event happened. This pseudo-event is included as a variant here to allow concise event handling on the user side.

§

SendCon

A CON message has been sent

§

SendNon

A NON message has been sent

§

SendPing

A ping has been sent

§

AckReceived

We have received an ACK to our request. This brings us into the OutgoingState::AwaitingResponse state.

§

Success(EncodedMessage<'a>)

We got a response to our request and consider the whole communication as successful. The response is included in the event. Afterwards, the OutgoingState will be [Idle(true)] which allows to obtain the response via message for later use.

§

Timeout

The communication attempt timed out.

§

PiggybackedWrongToken

We got a piggybacked response but the token does not match our request.

§

ResetReceived

We got a RST message. This cancels the ongoing request and brings us back to [Idle(false)].

§

DuplicatedResponse

We have received a response again which we have received before. If it is a separate CON response, the ACK is sent again automatically.

§

SendNotification

The notification message has been sent. If it was a CON message, we still wait for the ACK or RST. If it was a NON message, this includes a state transition into OutgoingState::Idle.

§

NotificationAck

A CON notification message has been acked. This includes a state transition into OutgoingState::Idle.

§

NotificationRst(Token)

The (CON or NON) notification message has been responded to with a RST. This signifies that the observer/receiver is not interested in further notifications about this resource. It should be removed from the list of registered observers for this resource.

§

NotificationTimeout

Transmitting a CON notification (with retransmissions) has timed out.

Trait Implementations§

Source§

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

§

impl<'a> !RefUnwindSafe for OutgoingEvent<'a>

§

impl<'a> Send for OutgoingEvent<'a>

§

impl<'a> !Sync for OutgoingEvent<'a>

§

impl<'a> Unpin for OutgoingEvent<'a>

§

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