Skip to main content

JoiningStart

Enum JoiningStart 

Source
pub enum JoiningStart {
    GroupsBefore(u64),
    Group(u64),
}
Expand description

Where a Joining FETCH starts, said once for the two forms the drafts give it.

A Joining FETCH names no track and no end. Draft-19 Section 10.12.2: “A Joining Fetch is associated with a Subscribe request by specifying the Request ID of an active subscription. A publisher receiving a Joining Fetch uses properties of the associated Subscribe to determine the Track Namespace, Track Name and End Location such that it is contiguous with the associated Subscribe.” So the only thing a subscriber still has to say is where the range begins — and the field that says it is one varint called Joining Start, which means two different things depending on a Fetch Type written six bytes earlier.

That is why this is an enum and not a u64. Section 10.12.2.1 gives the publisher two sentences for the same field: for a Relative Joining Fetch it sets the Start Location to “{Subscribe Largest Location.Group - Joining Start, 0}”, and for an Absolute Joining Fetch it sets the Start Location “to Joining Start”. A caller handing 3 to a single-number entry point would be asking for three groups of history on one call and for the whole track from Group 3 on the other, with nothing in the argument to say which was meant.

AnyConnection::fetch_joining turns the variant into the Fetch Type as well as the number, so the two cannot come apart.

Variants§

§

GroupsBefore(u64)

Start this many Groups before the joined subscription’s Largest Location — Fetch Type 0x2, Relative Joining.

GroupsBefore(0) is the subscription’s own current Group and nothing earlier; GroupsBefore(1) adds the Group before it. The publisher clamps at zero — “{Subscribe Largest Location.Group - Joining Start, 0}” — so an offset larger than the track is long asks for the whole of it rather than being an error.

This is the form a subscriber that has not been told a Largest Location can still use, which is most of them: it is the publisher that does the subtraction.

§

Group(u64)

Start at this Group, absolutely — Fetch Type 0x3, Absolute Joining.

The Start Location is {Group, 0}. Drafts 08 through 10 have no such Fetch Type — their FETCH offers Standalone and one Joining kind, and draft-11 is where the pair arrives — so this variant is refused there rather than sent as the relative one, which would ask a completely different question.

Trait Implementations§

Source§

impl Clone for JoiningStart

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for JoiningStart

Source§

impl Debug for JoiningStart

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for JoiningStart

Source§

impl PartialEq for JoiningStart

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for JoiningStart

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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