Skip to main content

Engine

Struct Engine 

Source
pub(crate) struct Engine<'a> {
    pub(crate) queue: Option<Queue<'a>>,
    pub(crate) closer: &'a SessionCloser,
}
Expand description

Everything execute may mutate.

Fields§

§queue: Option<Queue<'a>>

The stream’s queue, or None at the datagram site.

Datagrams are per-connection and unordered by definition, so they have no queue — and Action::Delay / Action::Hold are refused there, so nothing can need one. None is not a degraded mode; it is the datagram site’s shape.

§closer: &'a SessionCloser

Where Action::CloseSession is recorded.

Implementations§

Source§

impl Engine<'_>

Source

fn queue_is_busy(&self) -> bool

Whether a unit written now would overtake something already waiting — or would escape the pacer.

The second term is the whole of the release wiring’s reach into this module. Plan::WriteNow hands bytes straight to the transport, which is correct and cheap on an unshaped stream and is exactly the path a token bucket cannot see: PendingQueue::pop_next_due is the release seam, and a unit that never enters the queue never reaches it. So a shaped queue is always busy, and every unit on a shaped stream is released rather than written.

Nothing else in this module knows a class, a bucket or a discipline. The queue tags what it is handed from the class the pipe loop last resolved, so push_unit stays the one place a push and its ledger entry happen together.

Trait Implementations§

Source§

impl<'a> Debug for Engine<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for Engine<'a>

§

impl<'a> Freeze for Engine<'a>

§

impl<'a> RefUnwindSafe for Engine<'a>

§

impl<'a> Send for Engine<'a>

§

impl<'a> Sync for Engine<'a>

§

impl<'a> Unpin for Engine<'a>

§

impl<'a> UnsafeUnpin for Engine<'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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more