Struct r2r::qos::QosProfile

source ·
pub struct QosProfile {
    pub history: HistoryPolicy,
    pub depth: usize,
    pub reliability: ReliabilityPolicy,
    pub durability: DurabilityPolicy,
    pub deadline: Duration,
    pub lifespan: Duration,
    pub liveliness: LivelinessPolicy,
    pub liveliness_lease_duration: Duration,
    pub avoid_ros_namespace_conventions: bool,
}
Expand description

QoS profile

Fields§

§history: HistoryPolicy

History QoS policy setting.

§depth: usize

Size of the message queue.

§reliability: ReliabilityPolicy

Reliabiilty QoS policy setting.

§durability: DurabilityPolicy

Durability QoS policy setting.

§deadline: Duration

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

§lifespan: Duration

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

§liveliness: LivelinessPolicy

Liveliness QoS policy setting.

§liveliness_lease_duration: Duration

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

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

http://design.ros2.org/articles/topic_and_service_names.html#ros-specific-namespace-prefix

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

Implementations§

source§

impl QosProfile

source

pub const fn sensor_data() -> Self

Sensor Data QoS class

  • History: Keep last,
  • Depth: 5,
  • Reliability: Best effort,
  • Durability: Volatile,
  • Deadline: Default,
  • Lifespan: Default,
  • Liveliness: System default,
  • Liveliness lease duration: Default,
  • avoid ros namespace conventions: false
source

pub const fn parameters() -> Self

Parameters QoS class

  • History: Keep last,
  • Depth: 1000,
  • Reliability: Reliable,
  • Durability: Volatile,
  • Deadline: Default,
  • Lifespan: Default,
  • Liveliness: System default,
  • Liveliness lease duration: Default,
  • Avoid ros namespace conventions: false
source

pub const fn default() -> Self

Default QoS class

  • History: Keep last,
  • Depth: 10,
  • Reliability: Reliable,
  • Durability: Volatile,
  • Deadline: Default,
  • Lifespan: Default,
  • Liveliness: System default,
  • Liveliness lease duration: Default,
  • Avoid ros namespace conventions: false
source

pub const fn services_default() -> Self

Services QoS class

  • History: Keep last,
  • Depth: 10,
  • Reliability: Reliable,
  • Durability: Volatile,
  • Deadline: Default,
  • Lifespan: Default,
  • Liveliness: System default,
  • Liveliness lease duration: Default,
  • Avoid ros namespace conventions: false
source

pub const fn parameter_events() -> Self

Parameter events QoS class

  • History: Keep last,
  • Depth: 1000,
  • Reliability: Reliable,
  • Durability: Volatile,
  • Deadline: Default,
  • Lifespan: Default,
  • Liveliness: System default,
  • Liveliness lease duration: Default,
  • Avoid ros namespace conventions: false
source

pub const fn system_default() -> Self

System defaults QoS class

  • History: System default,
  • Depth: System default,
  • Reliability: System default,
  • Durability: System default,
  • Deadline: Default,
  • Lifespan: Default,
  • Liveliness: System default,
  • Liveliness lease duration: Default,
  • Avoid ros namespace conventions: false
source

pub const fn unknown() -> Self

Unknow QoS class

  • History: Unknown,
  • Depth: System default,
  • Reliability: Unknown,
  • Durability: Unknown,
  • Deadline: Default,
  • Lifespan: Default,
  • Liveliness: Unknown,
  • Liveliness lease duration: Default,
  • Avoid ros namespace conventions: false
source

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

Set the history policy.

§Examples
let qos = QosProfile::default().history(HistoryPolicy::KeepAll);
source

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

Set the history to keep last.

§Examples
let qos = QosProfile::default().keep_last(10);
source

pub const fn keep_all(self) -> Self

Set the history to keep all.

§Examples
let qos = QosProfile::default().keep_all();
source

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

Set the reliability setting.

§Examples
let qos = QosProfile::default().reliability(ReliabilityPolicy::Reliable);
source

pub const fn reliable(self) -> Self

Set the reliability setting to reliable.

§Examples
let qos = QosProfile::default().reliable();
source

pub const fn best_effort(self) -> Self

Set the reliability setting to best effort.

§Examples
let qos = QosProfile::default().best_effort();
source

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

Set the durability setting.

§Examples
let qos = QosProfile::default().durability(DurabilityPolicy::Volatile);
source

pub const fn volatile(self) -> Self

Set the durability setting to volatile.

§Examples
let qos = QosProfile::default().volatile();
source

pub const fn transient_local(self) -> Self

Set the durability setting to transient local.

§Examples
let qos = QosProfile::default().transient_local();
source

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

Set the deadline setting.

§Examples
let qos = QosProfile::default().deadline(Duration::from_secs(5));
source

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

Set the lifespan setting.

§Examples
let qos = QosProfile::default().lifespan(Duration::from_secs(5));
source

pub const fn liveliness(self, liveliness: LivelinessPolicy) -> Self

Set the liveliness setting.

§Examples
let qos = QosProfile::default().liveliness(LivelinessPolicy::Automatic);
source

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

Set the liveliness_lease_duration setting.

§Examples
let qos = QosProfile::default().liveliness_lease_duration(Duration::from_secs(5));
source

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

Set the avoid_ros_namespace_conventions setting.

§Examples
let qos = QosProfile::default().avoid_ros_namespace_conventions(true);

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 From<QosProfile> for rmw_qos_profile_t

source§

fn from(qos: QosProfile) -> Self

Converts to this type from the input type.
source§

impl From<rmw_qos_profile_s> for QosProfile

source§

fn from(rmw_qos: rmw_qos_profile_t) -> Self

Converts to this type from the input type.
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 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 T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
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.