Skip to main content

QosSettings

Struct QosSettings 

Source
pub struct QosSettings {
    pub history: QosHistoryPolicy,
    pub reliability: QosReliabilityPolicy,
    pub durability: QosDurabilityPolicy,
    pub liveliness_kind: QosLivelinessPolicy,
    pub depth: u32,
    pub deadline_ms: u32,
    pub lifespan_ms: u32,
    pub liveliness_lease_ms: u32,
    pub avoid_ros_namespace_conventions: bool,
}
Expand description

Full DDS-shaped QoS profile. Matches the field set of upstream rmw_qos_profile_t.

Backends advertise per-policy support via Session::supported_qos_policies; entities created with a profile the active backend can’t honour return TransportError::IncompatibleQos synchronously at create time — no silent downgrade.

Zero-valued time-window fields (“off”) mean infinite — the policy is effectively disabled for the entity.

Fields§

§history: QosHistoryPolicy

History policy

§reliability: QosReliabilityPolicy

Reliability policy

§durability: QosDurabilityPolicy

Durability policy

§liveliness_kind: QosLivelinessPolicy

Liveliness policy

§depth: u32

History depth (only used if history is KeepLast)

§deadline_ms: u32

Subscriber max-inter-arrival / publisher offered-rate, ms. 0 = infinite (no deadline check).

§lifespan_ms: u32

Sample expiry, ms. Subscribers filter samples older than this. 0 = infinite (no expiry).

§liveliness_lease_ms: u32

Liveliness lease, ms. 0 = infinite.

§avoid_ros_namespace_conventions: bool

If true, topic-name encoding skips the /rt/ ROS prefix.

Implementations§

Source§

impl QosSettings

Source

pub fn apply_overrides( self, topic: &str, role: QosOverrideRole, overrides: &[QosOverride], ) -> Self

Phase 211.H — fold the plan’s qos_overrides matching topic + role into this profile, returning the overridden profile. Setup-time only (called from create_publisher/create_subscription): a single linear scan over the baked &'static table, no alloc, RT-safe. Later entries win on a duplicate (topic, role, policy) (last-write), matching the planner’s sorted, de-conflicted emit. Non-matching entries are ignored, so passing the whole node table to every entity is cheap + correct.

Source§

impl QosSettings

Source

pub const BEST_EFFORT: Self

Best-effort QoS (for real-time)

Source

pub const RELIABLE: Self

Reliable QoS

Source

pub const QOS_PROFILE_SYSTEM_DEFAULT: Self

System default QoS profile (matches rmw_qos_profile_system_default)

Source

pub const QOS_PROFILE_DEFAULT: Self

Default QoS profile (matches rmw_qos_profile_default)

Source

pub const QOS_PROFILE_SENSOR_DATA: Self

Sensor data QoS profile (matches rmw_qos_profile_sensor_data)

Source

pub const QOS_PROFILE_SERVICES_DEFAULT: Self

Services default QoS profile (matches rmw_qos_profile_services_default)

Source

pub const QOS_PROFILE_PARAMETERS: Self

Parameters QoS profile (matches rmw_qos_profile_parameters)

Source

pub const QOS_PROFILE_CLOCK: Self

Clock QoS profile - same as sensor data but with depth 1

Source

pub const QOS_PROFILE_PARAMETER_EVENTS: Self

Parameter events QoS profile (matches rmw_qos_profile_parameter_events)

Source

pub const QOS_PROFILE_ACTION_STATUS_DEFAULT: Self

Action status default QoS profile (matches rcl_action_qos_profile_status_default)

Source

pub const QOS_PROFILE_PX4: Self

PX4 companion QoS profile (Phase 233 / RFC-0039 Track B). Matches the QoS PX4’s uxrce_dds_client uses on /fmu/out/* and /fmu/in/*BEST_EFFORT + VOLATILE + KEEP_LAST(1). A nano-ros node talking to the same MicroXRCEAgent must use this (a reliable or TRANSIENT_LOCAL reader will not match PX4’s volatile best-effort writers). Verified against real PX4 SITL (nros-px4-sitl-test): TRANSIENT_LOCAL durability silently fails to match /fmu/out/*. Adjust depth via .keep_last(n) for higher-rate streams.

Source

pub const fn new() -> Self

Create new QoS settings with defaults (matches QOS_PROFILE_DEFAULT: Reliable, Volatile, KeepLast(10)).

Source

pub const fn topics_default() -> Self

Get the default QoS profile for ordinary topics

Source

pub const fn px4() -> Self

The PX4 companion QoS profile (QOS_PROFILE_PX4) — use for /fmu/out/* subscriptions and /fmu/in/* publications against a MicroXRCEAgent.

Source

pub const fn sensor_data_default() -> Self

Get the default QoS profile for sensor data topics

Source

pub const fn services_default() -> Self

Get the default QoS profile for services

Source

pub const fn parameters_default() -> Self

Get the default QoS profile for parameter services

Source

pub const fn parameter_events_default() -> Self

Get the default QoS profile for parameter events

Source

pub const fn system_default() -> Self

Get the system default QoS profile

Source

pub const fn action_status_default() -> Self

Get the default QoS profile for action status topics

Source

pub const fn clock_default() -> Self

Get the default QoS profile for clock topics

Source

pub const fn keep_last(self, depth: u32) -> Self

Set history to keep last N messages

Source

pub const fn keep_all(self) -> Self

Set history to keep all messages

Source

pub const fn reliable(self) -> Self

Set reliability to reliable

Source

pub const fn best_effort(self) -> Self

Set reliability to best-effort

Source

pub const fn volatile(self) -> Self

Set durability to volatile

Source

pub const fn transient_local(self) -> Self

Set durability to transient local

Source

pub const fn reliability(self, policy: QosReliabilityPolicy) -> Self

Set reliability policy explicitly

Source

pub const fn durability(self, policy: QosDurabilityPolicy) -> Self

Set durability policy explicitly

Source

pub const fn history(self, policy: QosHistoryPolicy) -> Self

Set history policy explicitly

Source

pub const fn depth(self, depth: u32) -> Self

Set history depth explicitly

Source

pub const fn history_depth(&self) -> u8

Get history depth (for backwards compatibility)

Source§

impl QosSettings

Source

pub fn required_policies(&self) -> QosPolicyMask

Compute the set of QoS policies actually requested by this profile.

Zero-valued time fields and LivelinessKind::None count as “not requesting” the corresponding policy — the cheap default. The CORE bits (reliability, durability=VOLATILE, history, depth) are always present because every nano-ros backend honours them.

Source

pub fn validate_against( &self, supported: QosPolicyMask, ) -> Result<(), TransportError>

Returns Err(TransportError::IncompatibleQos) if any policy this profile requires is missing from the backend’s supported mask. Used at entity-create time to enforce the no silent degradation contract.

Trait Implementations§

Source§

impl Clone for QosSettings

Source§

fn clone(&self) -> QosSettings

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for QosSettings

Source§

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

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

impl Default for QosSettings

Source§

fn default() -> Self

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

impl PartialEq for QosSettings

Source§

fn eq(&self, other: &QosSettings) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for QosSettings

Source§

impl Eq for QosSettings

Source§

impl StructuralPartialEq for QosSettings

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.