Skip to main content

QoSPolicyMask

Struct QoSPolicyMask 

Source
pub struct QoSPolicyMask(pub u32);
Expand description

Bitmask of QoS policies a backend can honour. See Session::supported_qos_policies.

One bit per value QoSProfile::required_policies can request, and that function is the definition of what each bit MEANS — check-qos-mask- derivation reads the bit->field mapping out of its body rather than restating it, so a policy that gains a bit here and no arm there is a gate failure instead of a bit nothing can ever ask for.

Tuple Fields§

§0: u32

Implementations§

Source§

impl QoSPolicyMask

Source

pub const RELIABILITY: Self

Source

pub const DURABILITY_VOLATILE: Self

Source

pub const DURABILITY_TRANSIENT_LOCAL: Self

Source

pub const HISTORY: Self

Source

pub const DEPTH: Self

Source

pub const DEADLINE: Self

Source

pub const LIFESPAN: Self

Source

pub const LIVELINESS_AUTOMATIC: Self

Source

pub const LIVELINESS_MANUAL_BY_TOPIC: Self

Source

pub const LIVELINESS_MANUAL_BY_NODE: Self

Source

pub const LIVELINESS_LEASE: Self

Source

pub const AVOID_ROS_NAMESPACE_CONVENTIONS: Self

Source

pub const NONE: Self

Honours nothing. The default answer for an implementation that has not said otherwise — phase-428 W9, see Session::supported_qos_policies.

Source

pub const CORE: Self

The four policies every QoSProfile states a value for.

NOT “policies every nano-ros backend implements”, which is what this said until phase-428 W9 measured it: the zenoh shim honoured exactly none of the four, serialising all four into a discovery keyexpr and enforcing a build-time ring depth. The name describes the SHAPE of a profile — a caller who states nothing else still states these — and a backend still has to earn each bit.

Source

pub const NAMED: &'static [(Self, &'static CStr)]

Every policy bit paired with the name it PRINTS — the vocabulary the three languages name a refused policy in (phase-417 G7, ledger row cpp:qos_policy_kind_to_cstr).

The name of a bit is the CONSTANT’S OWN IDENTIFIER, never an independently chosen word. That is what keeps this from becoming the parallel table this campaign has paid for twice — the RMW parity map’s 28 stale slots and the layout gate’s three authored type names — and it is what check-qos-mask-derivation’s R8 measures: the entries here must be exactly the pub const … = Self(1 << n) bits above, each paired with its own spelling. A bit added above and not here is a gate failure, not a policy that silently prints as nothing.

Uppercase because that is upstream’s convention for the same strings: rclcpp::qos_policy_kind_to_cstr returns "DURABILITY", "DEADLINE", "LIVELINESS" and the rest.

NONE and CORE are deliberately absent: they are not policies, they are the empty mask and a named union, and neither can be the answer to “which policy was refused”.

The name is stored as a core::ffi::CStr and not as a &str, because the C entry point (rclc_qos_policy_kind_to_cstr) needs the trailing NUL and a &str does not carry one. Storing the &str form and NUL-terminating it in nros-c was the first shape here, and it put the twelve identifiers in a second file — which is the drift this row exists to avoid. One table, two readings: policy_name slices the NUL off for Rust, the C entry point hands the pointer straight over.

Source

pub const fn policy_name_cstr(self) -> Option<&'static CStr>

The name of the ONE policy this mask is, as a C string.

None for the empty mask and for a mask carrying more than one bit: both are real answers a diagnostic must be able to give. “The backend did not say which” is not a policy name, and printing a neighbouring one would be the plausible wrong answer this whole family exists to refuse.

Borrowed from a table in flash: no allocator, no formatting, reaches a bare-metal target, and these are the exact bytes the C and C++ entry points hand back.

Source

pub fn policy_name(self) -> Option<&'static str>

Self::policy_name_cstr as a Rust string — the same bytes without the terminator.

Source

pub const fn missing_from(self, supported: Self) -> Self

The policies in self that supported does not carry.

Source

pub const fn lowest_policy(self) -> Self

The lowest-numbered policy bit set here, or Self::NONE.

Which single policy a multi-policy refusal REPORTS. Lowest bit rather than “any”: a stable choice means the same profile against the same backend names the same policy on every run and in every language, so a test can assert it and two surfaces cannot disagree about which one to mention first.

Source

pub const fn contains(self, other: Self) -> bool

true if self contains every policy in other.

Source

pub const fn union(self, other: Self) -> Self

Bitwise OR of two masks.

Trait Implementations§

Source§

impl BitOr for QoSPolicyMask

Source§

type Output = QoSPolicyMask

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self

Performs the | operation. Read more
Source§

impl BitOrAssign for QoSPolicyMask

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl Clone for QoSPolicyMask

Source§

fn clone(&self) -> QoSPolicyMask

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 QoSPolicyMask

Source§

impl Debug for QoSPolicyMask

Source§

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

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

impl Eq for QoSPolicyMask

Source§

impl PartialEq for QoSPolicyMask

Source§

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

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 = Infallible

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.