Struct rustdds::dds::Subscriber [−][src]
DDS Subscriber
Examples
use rustdds::dds::Subscriber; let domain_participant = DomainParticipant::new(0); let qos = QosPolicyBuilder::new().build(); let subscriber = domain_participant.create_subscriber(&qos);
Implementations
impl Subscriber
[src]
pub fn create_datareader<D: 'static, SA>(
&self,
topic: Topic,
qos: Option<QosPolicies>
) -> Result<WithKeyDataReader<D, SA>> where
D: DeserializeOwned + Keyed,
<D as Keyed>::K: Key,
SA: DeserializerAdapter<D>,
[src]
&self,
topic: Topic,
qos: Option<QosPolicies>
) -> Result<WithKeyDataReader<D, SA>> where
D: DeserializeOwned + Keyed,
<D as Keyed>::K: Key,
SA: DeserializerAdapter<D>,
Creates DDS DataReader for keyed Topics
Arguments
topic
- Reference to the DDS Topic this reader reads fromentity_id
- Optional EntityId if necessary for DDS communication (random if None)qos
- Not in use
Examples
use serde::Deserialize; use rustdds::serialization::CDRDeserializerAdapter; use rustdds::dds::data_types::TopicKind; use rustdds::dds::traits::Keyed; let subscriber = domain_participant.create_subscriber(&qos).unwrap(); #[derive(Deserialize)] struct SomeType { a: i32 } impl Keyed for SomeType { type K = i32; fn get_key(&self) -> Self::K { self.a } } let topic = domain_participant.create_topic("some_topic", "SomeType", &qos, TopicKind::WithKey).unwrap(); let data_reader = subscriber.create_datareader::<SomeType, CDRDeserializerAdapter<_>>(topic, None, None);
pub fn create_datareader_CDR<D: 'static>(
&self,
topic: Topic,
qos: Option<QosPolicies>
) -> Result<WithKeyDataReader<D, CDRDeserializerAdapter<D>>> where
D: DeserializeOwned + Keyed,
<D as Keyed>::K: Key,
[src]
&self,
topic: Topic,
qos: Option<QosPolicies>
) -> Result<WithKeyDataReader<D, CDRDeserializerAdapter<D>>> where
D: DeserializeOwned + Keyed,
<D as Keyed>::K: Key,
pub fn create_datareader_no_key<D: 'static, SA>(
&self,
topic: Topic,
entity_id: Option<EntityId>,
qos: Option<QosPolicies>
) -> Result<NoKeyDataReader<D, SA>> where
D: DeserializeOwned,
SA: DeserializerAdapter<D>,
[src]
&self,
topic: Topic,
entity_id: Option<EntityId>,
qos: Option<QosPolicies>
) -> Result<NoKeyDataReader<D, SA>> where
D: DeserializeOwned,
SA: DeserializerAdapter<D>,
Create DDS DataReader for non keyed Topics
Arguments
topic
- Reference to the DDS Topic this reader reads fromentity_id
- Optional EntityId if necessary for DDS communication (random if None)qos
- Not in use
Examples
use serde::Deserialize; use rustdds::serialization::CDRDeserializerAdapter; use rustdds::dds::data_types::TopicKind; let subscriber = domain_participant.create_subscriber(&qos).unwrap(); #[derive(Deserialize)] struct SomeType {} let topic = domain_participant.create_topic("some_topic", "SomeType", &qos, TopicKind::NoKey).unwrap(); let data_reader = subscriber.create_datareader_no_key::<SomeType, CDRDeserializerAdapter<_>>(topic, None, None);
pub fn create_datareader_no_key_CDR<D: 'static>(
&self,
topic: Topic,
entity_id: Option<EntityId>,
qos: Option<QosPolicies>
) -> Result<NoKeyDataReader<D, CDRDeserializerAdapter<D>>> where
D: DeserializeOwned,
[src]
&self,
topic: Topic,
entity_id: Option<EntityId>,
qos: Option<QosPolicies>
) -> Result<NoKeyDataReader<D, CDRDeserializerAdapter<D>>> where
D: DeserializeOwned,
pub fn get_participant(&self) -> Option<DomainParticipant>
[src]
Returns DomainParticipant if it is sill alive.
Example
let domain_participant = DomainParticipant::new(0); let qos = QosPolicyBuilder::new().build(); let subscriber = domain_participant.create_subscriber(&qos).unwrap(); assert_eq!(domain_participant, subscriber.get_participant().unwrap());
Trait Implementations
impl Clone for Subscriber
[src]
fn clone(&self) -> Subscriber
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl !RefUnwindSafe for Subscriber
[src]
impl Send for Subscriber
[src]
impl Sync for Subscriber
[src]
impl Unpin for Subscriber
[src]
impl !UnwindSafe for Subscriber
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,