Skip to main content

FetchGaps

Struct FetchGaps 

Source
pub struct FetchGaps(Box<FetchGapTracker>);
Expand description

The Prior Group ID Gap and Prior Object ID Gap conditions of draft-17 Section 11.7 and draft-17 Section 11.8 that one fetch stream shows.

PriorGaps::from_properties refuses what one Object shows. Across the stream this refuses “A Group contains more than one Object with different values for Prior Group ID Gap” for the Objects of one Group, and “An endpoint receives an Object with a Group ID within a previously communicated gap” and its Prior Object ID Gap twin, for the Group and the Object before on the stream. It does not refuse “An endpoint receives an Object with a Prior Group ID Gap covering an Object it previously received” or its Prior Object ID Gap twin: draft-17 Section 2.1 says of an Object known to exist, “From this state, it can transition to not existing, but not vice versa”, so whether such a gap makes the Track malformed is ambiguous. draft-17 Section 9.14.3: “Within each group, objects are sent in Object ID order; subgroup ID is not used for ordering.”

FetchObjectReader::read_object_header applies it to each Object it reads.

End of Range indicators are not Objects; the caller passes Objects only.

Tuple Fields§

§0: Box<FetchGapTracker>

Implementations§

Source§

impl FetchGaps

Source

pub fn new() -> Self

Track the Objects of one fetch stream.

Source

pub fn check( &mut self, group_id: u64, object_id: u64, property_block: &[u8], ) -> Result<PriorGaps, CodecError>

Check the next Object on the stream, from its resolved Group ID and Object ID and its property block, refusing a gap condition with CodecError::MalformedTrack and a block that does not parse as crate::object_properties::parse_object_properties does. Records the Object only when it passes.

Trait Implementations§

Source§

impl Clone for FetchGaps

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

Source§

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

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

impl Default for FetchGaps

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for FetchGaps

Source§

impl PartialEq for FetchGaps

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 FetchGaps

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.