Skip to main content

AnyFetchObject

Struct AnyFetchObject 

Source
pub struct AnyFetchObject {
    pub group_id: u64,
    pub subgroup_id: u64,
    pub has_subgroup_id: bool,
    pub object_id: u64,
    pub publisher_priority: u8,
    pub extension_headers: Vec<u8>,
    pub extension_count: Option<u64>,
    pub status: Option<u64>,
    pub end_of_range: Option<AnyFetchEndOfRange>,
    pub payload: Vec<u8>,
}
Expand description

One frame read from a fetch data stream, normalised across drafts.

Usually an object. On drafts 16-19 it may instead be an End of Range indicator, which carries a Location and no content — Self::end_of_range is what tells the two apart, and it is None for every object.

Fields§

§group_id: u64

Absolute Group ID. Already resolved against the objects before it on drafts 15-19, whose fetch objects may omit the field or (on drafts 18-19) encode it as a difference; copied verbatim on drafts 07-14.

§subgroup_id: u64

Absolute Subgroup ID, resolved as Self::group_id is. Zero and meaningless when Self::has_subgroup_id is false.

§has_subgroup_id: bool

Whether this frame has a Subgroup ID at all.

true on every draft 07-15, and for every End of Range indicator’s predecessor. false in two cases drafts 16-19 add: an object whose Forwarding Preference is Datagram, which has no Subgroup ID anywhere in its framing, and an End of Range indicator, whose Location is a Group and Object ID only.

Kept beside subgroup_id rather than folded into it because a relay that writes this object onto another stream must not invent a Subgroup ID of zero for an object that has none: on the receiving draft zero is a real subgroup.

§object_id: u64

Absolute Object ID, resolved as Self::group_id is.

§publisher_priority: u8

Publisher Priority in force for this frame.

Drafts 15-19 let an object omit the field and take the previous object’s, and an End of Range indicator never carries one. Where nothing on the stream has stated a priority, this is 128 — the value every draft 15-19 gives a subscription whose Default Publisher Priority property is omitted (draft-19 Section 12.4).

§extension_headers: Vec<u8>

Extension/property block contents, excluding its prefix. Same convention as AnySubgroupObject::extension_headers.

§extension_count: Option<u64>

Number of extensions; Some only on draft-08. Same convention as AnySubgroupObject::extension_count.

§status: Option<u64>

Object Status wire code, present only when the payload is empty.

Always None on drafts 16-19: those drafts removed the field from fetch objects entirely, stating that Object Status “is only present in objects that are delivered via a SUBSCRIPTION, and is absent in Objects delivered via a FETCH” (draft-19 Section 11.2.1.1). A zero-length fetch object there is an object with no bytes, not a status object.

§end_of_range: Option<AnyFetchEndOfRange>

Which End of Range indicator this frame is, or None for an object.

An indicator has a Location and a payload length and nothing else: its payload, extension_headers and status are empty, its Self::has_subgroup_id is false, and its publisher_priority is whatever was in force rather than anything it stated.

§payload: Vec<u8>

Object payload. Empty when status is Some.

Trait Implementations§

Source§

impl Clone for AnyFetchObject

Source§

fn clone(&self) -> AnyFetchObject

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 AnyFetchObject

Source§

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

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

impl Eq for AnyFetchObject

Source§

impl PartialEq for AnyFetchObject

Source§

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

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, <T as TryFrom<U>>::Error>

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.