rclrs

Struct QoSProfile

Source
pub struct QoSProfile {
    pub history: QoSHistoryPolicy,
    pub reliability: QoSReliabilityPolicy,
    pub durability: QoSDurabilityPolicy,
    pub deadline: QoSDuration,
    pub lifespan: QoSDuration,
    pub liveliness: QoSLivelinessPolicy,
    pub liveliness_lease_duration: QoSDuration,
    pub avoid_ros_namespace_conventions: bool,
}
Expand description

A Quality of Service profile.

See docs.ros.org on Quality of Service settings in general.

In the general case, a topic can have multiple publishers and multiple subscriptions, each with an individual QoS profile. For each publisher-subscription pair, messages are only delivered if their QoS profiles are compatible.

§Example

let qos = QoSProfile {
    history: QoSHistoryPolicy::KeepLast { depth: 1 },
    ..QOS_PROFILE_SENSOR_DATA
};

Fields§

§history: QoSHistoryPolicy

The history policy.

§reliability: QoSReliabilityPolicy

The reliability policy.

§durability: QoSDurabilityPolicy

The durability policy.

§deadline: QoSDuration

The period at which messages are expected to be sent/received.

If this is Infinite, messages never miss a deadline expectation.

§lifespan: QoSDuration

The age at which messages are considered expired and no longer valid.

If this is Infinite, messages do not expire.

§liveliness: QoSLivelinessPolicy

The liveliness policy.

§liveliness_lease_duration: QoSDuration

The time within which the RMW publisher must show that it is alive.

If this is Infinite, liveliness is not enforced.

§avoid_ros_namespace_conventions: bool

If true, any ROS specific namespacing conventions will be circumvented.

In the case of DDS and topics, for example, this means the typical ROS specific prefix of rt would not be applied as described here.

This might be useful when trying to directly connect a native DDS topic with a ROS 2 topic.

Implementations§

Source§

impl QoSProfile

Source

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

Sets the QoS profile history to QoSHistoryPolicy::KeepLast with the specified depth.

Source

pub fn keep_all(self) -> Self

Sets the QoS profile history to QoSHistoryPolicy::KeepAll.

Source

pub fn reliable(self) -> Self

Sets the QoS profile reliability to QoSReliabilityPolicy::Reliable.

Source

pub fn best_effort(self) -> Self

Sets the QoS profile reliability to QoSReliabilityPolicy::BestEffort.

Source

pub fn volatile(self) -> Self

Sets the QoS profile durability to QoSDurabilityPolicy::Volatile.

Source

pub fn transient_local(self) -> Self

Sets the QoS profile durability to QoSDurabilityPolicy::TransientLocal.

Source

pub fn deadline(self, deadline: Duration) -> Self

Sets the QoS profile deadline to the specified Duration.

Source

pub fn liveliness_lease_duration(self, lease_duration: Duration) -> Self

Sets the QoS profile liveliness lease duration to the specified Duration.

Source

pub fn lifespan(self, lifespan: Duration) -> Self

Sets the QoS profile lifespan to the specified Duration.

Trait Implementations§

Source§

impl Clone for QoSProfile

Source§

fn clone(&self) -> QoSProfile

Returns a copy 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 QoSProfile

Source§

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

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

impl Default for QoSProfile

Sets the QoSProfile to the RCL default.

Source§

fn default() -> Self

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

impl Ord for QoSProfile

Source§

fn cmp(&self, other: &QoSProfile) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for QoSProfile

Source§

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

Source§

fn partial_cmp(&self, other: &QoSProfile) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for QoSProfile

Source§

impl Eq for QoSProfile

Source§

impl StructuralPartialEq for QoSProfile

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.