Skip to main content

PublisherBuilder

Struct PublisherBuilder 

Source
pub struct PublisherBuilder<'domain, 'participant, 'qos> { /* private fields */ }
Expand description

Builder for Publisher (accessible via Publisher::builder).

Implementations§

Source§

impl<'d, 'p, 'q> PublisherBuilder<'d, 'p, 'q>

Source

pub const fn new(participant: &'p Participant<'d>) -> Self

Creates a new PublisherBuilder for the given Participant.

§Examples
use cyclonedds::builder::PublisherBuilder;
use cyclonedds::{Domain, Participant};

let domain = Domain::default();
let participant = Participant::new(&domain)?;
let publisher_builder = PublisherBuilder::new(&participant);
Source

pub const fn with_qos(self, qos: &'q QoS) -> Self

Sets the QoS for this publisher builder.

§Examples
use cyclonedds::builder::PublisherBuilder;
use cyclonedds::qos::policy;
use cyclonedds::{Duration, QoS};

let qos = QoS::new().with_reliability(policy::Reliability::Reliable {
    max_blocking_time: Duration::from_millis(100),
});
let publisher_builder = PublisherBuilder::new(&participant).with_qos(&qos);
Source

pub fn with_listener<L>(self, listener: L) -> Self

Sets the Listener on this publisher builder.

§Examples
use cyclonedds::Listener;
use cyclonedds::builder::PublisherBuilder;

let publisher_builder = PublisherBuilder::new(&participant).with_listener(Listener::new());
Source

pub fn build(self) -> Result<Publisher<'d, 'p>>

Builds the Publisher.

§Errors

Returns an Error if the publisher failed to create.

§Examples
use cyclonedds::QoS;
use cyclonedds::builder::PublisherBuilder;
use cyclonedds::qos::policy;

let qos = QoS::new().with_durability(policy::Durability::TransientLocal);
let publisher = PublisherBuilder::new(&participant).with_qos(&qos).build()?;

Trait Implementations§

Source§

impl<'domain, 'participant, 'qos> Debug for PublisherBuilder<'domain, 'participant, 'qos>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'domain, 'participant, 'qos> !Send for PublisherBuilder<'domain, 'participant, 'qos>

§

impl<'domain, 'participant, 'qos> !Sync for PublisherBuilder<'domain, 'participant, 'qos>

§

impl<'domain, 'participant, 'qos> Freeze for PublisherBuilder<'domain, 'participant, 'qos>

§

impl<'domain, 'participant, 'qos> RefUnwindSafe for PublisherBuilder<'domain, 'participant, 'qos>

§

impl<'domain, 'participant, 'qos> Unpin for PublisherBuilder<'domain, 'participant, 'qos>

§

impl<'domain, 'participant, 'qos> UnsafeUnpin for PublisherBuilder<'domain, 'participant, 'qos>

§

impl<'domain, 'participant, 'qos> UnwindSafe for PublisherBuilder<'domain, 'participant, 'qos>

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> 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> Same for T

Source§

type Output = T

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