Skip to main content

AnyInboundRequest

Enum AnyInboundRequest 

Source
pub enum AnyInboundRequest {
    ControlPlane {
        request_id: VarInt,
        draft: DraftVersion,
    },
    Draft17(RequestStream),
    Draft18(RequestStream),
    Draft19(RequestStream),
    Draft20(RequestStream),
    Draft21(RequestStream),
}
Expand description

A request the peer made, and the handle this side answers it through.

The mirror of AnyRequest, and split the same way and for the same reason: drafts 07 through 16 carry every request on one shared control stream and identify it by its Request ID, and from draft-17 each request owns a bidirectional stream that is its identity. What differs is who allocated the ID — here the peer did, so it is read off the message rather than out of this endpoint’s own sequence.

There is no Draft16 stream variant, unlike AnyRequest. Draft-16 gave a stream to namespace subscriptions alone, and an inbound SUBSCRIBE on that draft still arrives on the control stream.

Dropping an unanswered request from draft-17 on resets its stream, which the peer reads as a refusal. Dropping a AnyInboundRequest::ControlPlane does nothing at all, and the peer is left waiting — refusing there means sending the draft’s own error message through the variant.

Variants§

§

ControlPlane

Drafts 07-16: identified only by the Request ID the peer allocated.

Fields

§request_id: VarInt

The Request ID the peer put on the message.

§draft: DraftVersion

The draft that carried it.

§

Draft17(RequestStream)

Draft-17: the request arrived on a bidirectional stream of its own.

§

Draft18(RequestStream)

Draft-18: the request arrived on a bidirectional stream of its own.

§

Draft19(RequestStream)

Draft-19: the request arrived on a bidirectional stream of its own.

§

Draft20(RequestStream)

Draft-20: the request arrived on a bidirectional stream of its own.

§

Draft21(RequestStream)

Draft-21: the request arrived on a bidirectional stream of its own.

Implementations§

Source§

impl AnyInboundRequest

Source

pub fn request_id(&self) -> VarInt

The Request ID the peer allocated for this request.

Source

pub fn draft(&self) -> DraftVersion

The draft that carries this request.

Source

pub fn stream_id(&self) -> Option<u64>

The transport stream this request arrived on, or None on a draft that carries inbound requests on the shared control stream.

The same observable difference AnyRequest::stream_id exposes, in the other direction.

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