Skip to main content

FetchOk

Struct FetchOk 

Source
pub struct FetchOk {
    pub end_of_track: u8,
    pub end_group: VarInt,
    pub end_object: VarInt,
    pub parameters: Vec<KeyValuePair>,
    pub track_properties: Vec<KeyValuePair>,
}
Expand description

FETCH_OK (0x18). end_of_track is uint8.

Byte-identical to draft-19; the field that changed meaning is FetchOk::end_object.

Fields§

§end_of_track: u8§end_group: VarInt§end_object: VarInt

The Object ID of the last Object the response covers, inclusive.

This is the silent off-by-one of the revision, and it is absent from draft-20’s own change log. Draft-19 Section 10.13 defined the pair as “the end of the range covered by the FETCH response, using the same encoding as the FETCH request End Location (the last Object, plus 1; or 0 to indicate the entire Group)”. Draft-20 Section 10.14 drops that parenthesis entirely, and Sections 5.1.2 and 10.13 both say the Location filter “specifies an inclusive range of Locations”.

So both draft-19 conventions are gone: there is no plus one, and an Object of 0 now means object 0 rather than the whole group. The bytes are identical between the two drafts and the meaning is not, and nothing on the wire distinguishes them — an encoder ported forward with its arithmetic intact fetches one object too many, and one whose end lands on object 0 fetches a single object where it used to fetch a group.

Ambiguous, and the draft leaves it so. When the request’s filter omitted EndObject, so the filter meant “all objects in the End Group”, Section 10.14 does not say what to report — and with the 0-means-whole-group encoding gone there is no way left to spell it. The same applies to a relative start. The reading this codec’s corpus takes, and the only sane one, is the Object ID of the last Object actually covered; the draft does not say so, and nothing here can enforce it, because resolving it needs the track rather than the frame.

§parameters: Vec<KeyValuePair>§track_properties: Vec<KeyValuePair>

Trait Implementations§

Source§

impl Clone for FetchOk

Source§

fn clone(&self) -> FetchOk

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 Debug for FetchOk

Source§

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

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

impl Eq for FetchOk

Source§

impl PartialEq for FetchOk

Source§

fn eq(&self, other: &FetchOk) -> 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 FetchOk

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.

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.