Skip to main content

CapCtx

Struct CapCtx 

Source
#[non_exhaustive]
pub struct CapCtx { pub draft: Option<DraftVersion>, pub stream_kind: Option<DataStreamType>, pub is_control_stream: Option<bool>, pub index_in_stream: Option<u64>, pub subgroup_id_resolved: Option<bool>, pub is_status_object: Option<bool>, pub payload_len: Option<u64>, pub replacement_len: Option<u64>, pub payload_delimited: Option<bool>, pub subgroup_id_mode: Option<u8>, }
Expand description

The facts classify needs.

A caller building the published table leaves the per-unit fields None and gets Support::Conditional where the answer depends on them; the engine fills them in and gets Support::Yes or Support::No.

The struct is #[non_exhaustive], so build one with CapCtx::default and assign the fields that are known.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§draft: Option<DraftVersion>

The draft the session is running as.

§stream_kind: Option<DataStreamType>

Which stream kind, at the object site.

§is_control_stream: Option<bool>

Whether the stream is a control stream.

Read at Site::StreamEnd, which publishes two columns: Some(true) selects the control column, and Some(false) or None the data one.

§index_in_stream: Option<u64>

Zero-based index of the object within its stream.

§subgroup_id_resolved: Option<bool>

Whether the stream header determines the subgroup ID.

§is_status_object: Option<bool>

Whether the object carries an Object Status.

§payload_len: Option<u64>

Declared payload length.

§replacement_len: Option<u64>

Length of a proposed replacement payload.

§payload_delimited: Option<bool>

Whether this unit’s payload starts at a known offset.

Always Some(true) at the object site. At the datagram site the engine sets it from data.len() - cursor.len() being a real boundary — false on draft-14, on a status datagram, and when the header did not decode. Drives Precondition::DatagramPayloadDelimited.

§subgroup_id_mode: Option<u8>

The two-bit subgroup-ID mode, on the drafts 15-19 whose header type carries one. None on drafts 07-14, which have no such pair of bits, and when the caller did not supply it. Mode 1 is subgroup ID is the first object’s ID; mode 3 is the value no draft assigns. Drives the split between Refusal::WouldRedefineSubgroupId and Refusal::ReservedHeaderMode.

Trait Implementations§

Source§

impl Clone for CapCtx

Source§

fn clone(&self) -> CapCtx

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 CapCtx

Source§

impl Debug for CapCtx

Source§

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

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

impl Default for CapCtx

Source§

fn default() -> CapCtx

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

impl Eq for CapCtx

Source§

impl PartialEq for CapCtx

Source§

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

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

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, <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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more