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: QosHistoryPolicyHistory policy
reliability: QosReliabilityPolicyReliability policy
durability: QosDurabilityPolicyDurability policy
liveliness_kind: QosLivelinessPolicyLiveliness policy
depth: u32History depth (only used if history is KeepLast)
deadline_ms: u32Subscriber max-inter-arrival / publisher offered-rate, ms.
0 = infinite (no deadline check).
lifespan_ms: u32Sample expiry, ms. Subscribers filter samples older than this.
0 = infinite (no expiry).
liveliness_lease_ms: u32Liveliness lease, ms. 0 = infinite.
avoid_ros_namespace_conventions: boolIf true, topic-name encoding skips the /rt/ ROS prefix.
Implementations§
Source§impl QosSettings
impl QosSettings
Sourcepub fn apply_overrides(
self,
topic: &str,
role: QosOverrideRole,
overrides: &[QosOverride],
) -> Self
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
impl QosSettings
Sourcepub const BEST_EFFORT: Self
pub const BEST_EFFORT: Self
Best-effort QoS (for real-time)
Sourcepub const QOS_PROFILE_SYSTEM_DEFAULT: Self
pub const QOS_PROFILE_SYSTEM_DEFAULT: Self
System default QoS profile (matches rmw_qos_profile_system_default)
Sourcepub const QOS_PROFILE_DEFAULT: Self
pub const QOS_PROFILE_DEFAULT: Self
Default QoS profile (matches rmw_qos_profile_default)
Sourcepub const QOS_PROFILE_SENSOR_DATA: Self
pub const QOS_PROFILE_SENSOR_DATA: Self
Sensor data QoS profile (matches rmw_qos_profile_sensor_data)
Sourcepub const QOS_PROFILE_SERVICES_DEFAULT: Self
pub const QOS_PROFILE_SERVICES_DEFAULT: Self
Services default QoS profile (matches rmw_qos_profile_services_default)
Sourcepub const QOS_PROFILE_PARAMETERS: Self
pub const QOS_PROFILE_PARAMETERS: Self
Parameters QoS profile (matches rmw_qos_profile_parameters)
Sourcepub const QOS_PROFILE_CLOCK: Self
pub const QOS_PROFILE_CLOCK: Self
Clock QoS profile - same as sensor data but with depth 1
Sourcepub const QOS_PROFILE_PARAMETER_EVENTS: Self
pub const QOS_PROFILE_PARAMETER_EVENTS: Self
Parameter events QoS profile (matches rmw_qos_profile_parameter_events)
Sourcepub const QOS_PROFILE_ACTION_STATUS_DEFAULT: Self
pub const QOS_PROFILE_ACTION_STATUS_DEFAULT: Self
Action status default QoS profile (matches rcl_action_qos_profile_status_default)
Sourcepub const QOS_PROFILE_PX4: Self
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.
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Create new QoS settings with defaults (matches QOS_PROFILE_DEFAULT:
Reliable, Volatile, KeepLast(10)).
Sourcepub const fn topics_default() -> Self
pub const fn topics_default() -> Self
Get the default QoS profile for ordinary topics
Sourcepub const fn px4() -> Self
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.
Sourcepub const fn sensor_data_default() -> Self
pub const fn sensor_data_default() -> Self
Get the default QoS profile for sensor data topics
Sourcepub const fn services_default() -> Self
pub const fn services_default() -> Self
Get the default QoS profile for services
Sourcepub const fn parameters_default() -> Self
pub const fn parameters_default() -> Self
Get the default QoS profile for parameter services
Sourcepub const fn parameter_events_default() -> Self
pub const fn parameter_events_default() -> Self
Get the default QoS profile for parameter events
Sourcepub const fn system_default() -> Self
pub const fn system_default() -> Self
Get the system default QoS profile
Sourcepub const fn action_status_default() -> Self
pub const fn action_status_default() -> Self
Get the default QoS profile for action status topics
Sourcepub const fn clock_default() -> Self
pub const fn clock_default() -> Self
Get the default QoS profile for clock topics
Sourcepub const fn best_effort(self) -> Self
pub const fn best_effort(self) -> Self
Set reliability to best-effort
Sourcepub const fn transient_local(self) -> Self
pub const fn transient_local(self) -> Self
Set durability to transient local
Sourcepub const fn reliability(self, policy: QosReliabilityPolicy) -> Self
pub const fn reliability(self, policy: QosReliabilityPolicy) -> Self
Set reliability policy explicitly
Sourcepub const fn durability(self, policy: QosDurabilityPolicy) -> Self
pub const fn durability(self, policy: QosDurabilityPolicy) -> Self
Set durability policy explicitly
Sourcepub const fn history(self, policy: QosHistoryPolicy) -> Self
pub const fn history(self, policy: QosHistoryPolicy) -> Self
Set history policy explicitly
Sourcepub const fn history_depth(&self) -> u8
pub const fn history_depth(&self) -> u8
Get history depth (for backwards compatibility)
Source§impl QosSettings
impl QosSettings
Sourcepub fn required_policies(&self) -> QosPolicyMask
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.
Sourcepub fn validate_against(
&self,
supported: QosPolicyMask,
) -> Result<(), TransportError>
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
impl Clone for QosSettings
Source§fn clone(&self) -> QosSettings
fn clone(&self) -> QosSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more