Skip to main content

AnyFetchReader

Enum AnyFetchReader 

Source
pub enum AnyFetchReader {
Show 15 variants Draft07(FramedRecvStream), Draft08(FramedRecvStream), Draft09(FramedRecvStream), Draft10(FramedRecvStream), Draft11(FramedRecvStream), Draft12(FramedRecvStream), Draft13(FramedRecvStream), Draft14(FramedRecvStream), Draft15(FramedRecvStream), Draft16(Draft16FetchStream), Draft17(FramedRecvStream), Draft18(FramedRecvStream), Draft19(FramedRecvStream), Draft20(FramedRecvStream), Draft21(FramedRecvStream),
}
Expand description

A fetch stream the peer opened, that this endpoint is reading.

AnySubgroupReader’s twin, returned by AnyConnection::accept_fetch beside the FETCH_HEADER the peer framed it with.

The two are separate types for the reason the per-draft connections keep accept_fetch_stream and accept_subgroup_stream separate: the header decides how every object after it is framed, so a caller has to know which kind it is expecting before the first byte is read. Nothing here can be handed a subgroup stream and cope.

Variants§

§

Draft07(FramedRecvStream)

Draft-07’s fetch stream.

§

Draft08(FramedRecvStream)

Draft-08’s fetch stream.

§

Draft09(FramedRecvStream)

Draft-09’s fetch stream.

§

Draft10(FramedRecvStream)

Draft-10’s fetch stream.

§

Draft11(FramedRecvStream)

Draft-11’s fetch stream.

§

Draft12(FramedRecvStream)

Draft-12’s fetch stream.

§

Draft13(FramedRecvStream)

Draft-13’s fetch stream.

§

Draft14(FramedRecvStream)

Draft-14’s fetch stream.

§

Draft15(FramedRecvStream)

Draft-15’s fetch stream.

§

Draft16(Draft16FetchStream)

Draft-16’s fetch stream, and the resolver its objects need. See Draft16FetchStream.

§

Draft17(FramedRecvStream)

Draft-17’s fetch stream.

§

Draft18(FramedRecvStream)

Draft-18’s fetch stream.

§

Draft19(FramedRecvStream)

Draft-19’s fetch stream.

§

Draft20(FramedRecvStream)

Draft-20’s fetch stream.

§

Draft21(FramedRecvStream)

Draft-21’s fetch stream.

Implementations§

Source§

impl AnyFetchReader

Source

pub fn draft(&self) -> DraftVersion

The draft framing this stream.

Source

pub fn stream_id(&self) -> u64

Which stream this fetch arrived on, on the terms AnySubgroupWriter::stream_id describes.

Source

pub async fn read_object( &mut self, ) -> Result<AnyFetchObject, AnyConnectionError>

Read the next object on this fetch stream.

§The stream’s end arrives as an error, not as None

For the reason AnySubgroupReader::read_object gives, and one more of its own: a fetch stream ends when the range it was serving runs out, and the only thing that says so is the FIN. Returning Option would have to tell that FIN from a peer that stopped mid-object, which no per-draft reader can.

§Errors

Everything AnySubgroupReader::read_object can raise, and on drafts 15 through 20 one more class of its own: an object that inherits from an object that does not exist. The first object of a stream may not leave out its Group ID or its Object ID, and a stream whose first object does is refused here rather than resolved against zero — draft-16 Section 10.4.4.1 makes it a PROTOCOL_VIOLATION, and there is no value to produce even where it does not.

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