Struct rustdds::dds::Publisher[][src]

pub struct Publisher { /* fields omitted */ }

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]

Creates DDS DataWriter for Keyed topic

Arguments

  • entity_id - Custom entity id if necessary for the user to define it
  • topic - Reference to DDS Topic this writer is created to
  • qos - 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]

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]

Creates DDS DataWriter for Nokey Topic

Arguments

  • entity_id - Custom entity id if necessary for the user to define it
  • topic - Reference to DDS Topic this writer is created to
  • qos - 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]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,