Struct rustdds::dds::Publisher [−][src]
DDS Publisher
Examples
use rustdds::dds::Publisher; let domain_participant = DomainParticipant::new(0); let qos = QosPolicyBuilder::new().build(); let publisher = domain_participant.create_publisher(&qos);
Implementations
impl Publisher
[src]
pub fn create_datawriter<D, SA>(
&self,
topic: Topic,
qos: Option<QosPolicies>
) -> Result<WithKeyDataWriter<D, SA>> where
D: Keyed + Serialize,
<D as Keyed>::K: Key,
SA: SerializerAdapter<D>,
[src]
&self,
topic: Topic,
qos: Option<QosPolicies>
) -> Result<WithKeyDataWriter<D, SA>> where
D: Keyed + Serialize,
<D as Keyed>::K: Key,
SA: SerializerAdapter<D>,
Creates DDS DataWriter for Keyed topic
Arguments
entity_id
- Custom entity id if necessary for the user to define ittopic
- Reference to DDS Topic this writer is created toqos
- Not currently in use
Examples
use rustdds::dds::traits::Keyed; use rustdds::serialization::CDRSerializerAdapter; use serde::Serialize; let domain_participant = DomainParticipant::new(0); let qos = QosPolicyBuilder::new().build(); let publisher = domain_participant.create_publisher(&qos).unwrap(); #[derive(Serialize)] 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_writer = publisher.create_datawriter::<SomeType, CDRSerializerAdapter<_>>(None, topic, None);
pub fn create_datawriter_CDR<D>(
&self,
topic: Topic,
qos: Option<QosPolicies>
) -> Result<WithKeyDataWriter<D, CDRSerializerAdapter<D, LittleEndian>>> where
D: Keyed + Serialize,
<D as Keyed>::K: Key,
[src]
&self,
topic: Topic,
qos: Option<QosPolicies>
) -> Result<WithKeyDataWriter<D, CDRSerializerAdapter<D, LittleEndian>>> where
D: Keyed + Serialize,
<D as Keyed>::K: Key,
Shorthand for crate_datawriter with Commaon Data Representation Little Endian
pub fn create_datawriter_no_key<D, SA>(
&self,
topic: Topic,
qos: Option<QosPolicies>
) -> Result<NoKeyDataWriter<D, SA>> where
D: Serialize,
SA: SerializerAdapter<D>,
[src]
&self,
topic: Topic,
qos: Option<QosPolicies>
) -> Result<NoKeyDataWriter<D, SA>> where
D: Serialize,
SA: SerializerAdapter<D>,
Creates DDS DataWriter for Nokey Topic
Arguments
entity_id
- Custom entity id if necessary for the user to define ittopic
- Reference to DDS Topic this writer is created toqos
- QoS policies for this DataWriter
Examples
use rustdds::serialization::CDRSerializerAdapter; use serde::Serialize; let domain_participant = DomainParticipant::new(0); let qos = QosPolicyBuilder::new().build(); let publisher = domain_participant.create_publisher(&qos).unwrap(); #[derive(Serialize)] struct SomeType {} let topic = domain_participant.create_topic("some_topic", "SomeType", &qos, TopicKind::WithKey).unwrap(); let data_writer = publisher.create_datawriter_no_key::<SomeType, CDRSerializerAdapter<_>>(None, topic, None);
pub fn create_datawriter_no_key_CDR<D>(
&self,
topic: Topic,
qos: Option<QosPolicies>
) -> Result<NoKeyDataWriter<D, CDRSerializerAdapter<D, LittleEndian>>> where
D: Serialize,
[src]
&self,
topic: Topic,
qos: Option<QosPolicies>
) -> Result<NoKeyDataWriter<D, CDRSerializerAdapter<D, LittleEndian>>> where
D: Serialize,
pub fn suspend_publications(&self) -> Result<()>
[src]
Currently does nothing
pub fn resume_publications(&self) -> Result<()>
[src]
Currently does nothing
pub fn begin_coherent_changes(&self) -> Result<()>
[src]
Coherent set not implemented and currently does nothing
pub fn end_coherent_changes(&self) -> Result<()>
[src]
Coherent set not implemented and currently does nothing
pub fn get_participant(&self) -> Option<DomainParticipant>
[src]
Gets DomainParticipant if it has not disappeared from all scopes.
Example
let domain_participant = DomainParticipant::new(0); let qos = QosPolicyBuilder::new().build(); let publisher = domain_participant.create_publisher(&qos).unwrap(); assert_eq!(domain_participant, publisher.get_participant().unwrap());
pub fn get_default_datawriter_qos(&self) -> QosPolicies
[src]
Returns default DataWriter qos. Currently default qos is not used.
Example
use rustdds::dds::qos::{QosPolicyBuilder}; let domain_participant = DomainParticipant::new(0); let qos = QosPolicyBuilder::new().build(); let publisher = domain_participant.create_publisher(&qos).unwrap(); assert_eq!(qos, publisher.get_default_datawriter_qos());
Trait Implementations
impl Clone for Publisher
[src]
impl Debug for Publisher
[src]
impl PartialEq<Publisher> for Publisher
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Publisher
[src]
impl Send for Publisher
[src]
impl Sync for Publisher
[src]
impl Unpin for Publisher
[src]
impl !UnwindSafe for Publisher
[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>,