Skip to main content

ReceiveTrafficState

Enum ReceiveTrafficState 

Source
pub enum ReceiveTrafficState<'a, Side: SideData> {
    ReadMore(ReceiveTraffic<Side>),
    FlushSender(FlushSender<Side>),
    Available(ReceivedApplicationData<'a, Side>),
    CloseNotify,
}
Expand description

A state machine that cycles between requiring further received TLS data and discharging received application data.

Each call to ReceiveTraffic::read() returns one of these states, and each non-terminal state lets you obtain the next one: ReadMore by supplying more input and calling read() again, and FlushSender / Available through their into_next() methods. CloseNotify is terminal.

           ╭────────────────╮
  ╭───────▶│ ReceiveTraffic │
  │        ╰───────┬────────╯
ReadMore           │ read(&mut input)
  │                ▼
  ╰────╭───────────────────────╮
       │  ReceiveTrafficState  │──── CloseNotify ────▶ (terminal)
  ╭───▶╰──┬────────────────────╯
  │       │              │
  │  FlushSender      Available
  │  .into_next()    .into_next()
  │       │              │
  ╰───────┴──────────────╯

Variants§

§

ReadMore(ReceiveTraffic<Side>)

More input is required.

Collect it into your input buffer, and then call ReceiveTraffic::read() again.

§

FlushSender(FlushSender<Side>)

The sender may have new data to send.

§

Available(ReceivedApplicationData<'a, Side>)

Some application data has been received.

§

CloseNotify

We received a close_notify alert from the peer.

This means the receive path is closed cleanly.

Trait Implementations§

Source§

impl<Side: SideData> Debug for ReceiveTrafficState<'_, Side>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, Side> !RefUnwindSafe for ReceiveTrafficState<'a, Side>

§

impl<'a, Side> !Send for ReceiveTrafficState<'a, Side>

§

impl<'a, Side> !Sync for ReceiveTrafficState<'a, Side>

§

impl<'a, Side> !UnwindSafe for ReceiveTrafficState<'a, Side>

§

impl<'a, Side> Freeze for ReceiveTrafficState<'a, Side>
where <Side as Side>::State: Freeze,

§

impl<'a, Side> Unpin for ReceiveTrafficState<'a, Side>
where <Side as Side>::State: Unpin,

§

impl<'a, Side> UnsafeUnpin for ReceiveTrafficState<'a, Side>
where <Side as Side>::State: UnsafeUnpin,

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.