pub struct WriterBuilder<'domain, 'participant, 'topic, 'qos, T>where
T: Topicable,{ /* private fields */ }Expand description
Builder for Writer<T> (accessible via Writer::builder).
Implementations§
Source§impl<'d, 'p, 't, 'q, T> WriterBuilder<'d, 'p, 't, 'q, T>where
T: Topicable,
impl<'d, 'p, 't, 'q, T> WriterBuilder<'d, 'p, 't, 'q, T>where
T: Topicable,
Sourcepub const fn new(topic: &'t Topic<'d, 'p, T>) -> Self
pub const fn new(topic: &'t Topic<'d, 'p, T>) -> Self
Creates a new WriterBuilder for the given Topic.
§Examples
use cyclonedds::builder::WriterBuilder;
use cyclonedds::{Domain, Participant, Topic};
let domain = Domain::default();
let participant = Participant::new(&domain)?;
let topic = Topic::new(&participant, "MyTopic")?;
let writer_builder = WriterBuilder::<Data>::new(&topic);Sourcepub const fn with_qos(self, qos: &'q QoS) -> Self
pub const fn with_qos(self, qos: &'q QoS) -> Self
Sets the QoS for this writer builder.
§Examples
use cyclonedds::builder::WriterBuilder;
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 writer_builder = WriterBuilder::<Data>::new(&topic).with_qos(&qos);Sourcepub const fn with_publisher(self, publisher: &'p Publisher<'d, 'p>) -> Self
pub const fn with_publisher(self, publisher: &'p Publisher<'d, 'p>) -> Self
Sourcepub fn with_listener<L>(self, listener: L) -> Selfwhere
L: AsRef<WriterListener<T>>,
pub fn with_listener<L>(self, listener: L) -> Selfwhere
L: AsRef<WriterListener<T>>,
Sourcepub fn build(self) -> Result<Writer<'d, 'p, 't, T>>
pub fn build(self) -> Result<Writer<'d, 'p, 't, T>>
Builds the Writer.
§Errors
Returns an Error if the writer failed to create.
§Examples
use cyclonedds::QoS;
use cyclonedds::builder::WriterBuilder;
use cyclonedds::qos::policy;
let qos = QoS::new().with_durability(policy::Durability::TransientLocal);
let writer = WriterBuilder::<Data>::new(&topic).with_qos(&qos).build()?;Trait Implementations§
Auto Trait Implementations§
impl<'domain, 'participant, 'topic, 'qos, T> !Send for WriterBuilder<'domain, 'participant, 'topic, 'qos, T>
impl<'domain, 'participant, 'topic, 'qos, T> !Sync for WriterBuilder<'domain, 'participant, 'topic, 'qos, T>
impl<'domain, 'participant, 'topic, 'qos, T> Freeze for WriterBuilder<'domain, 'participant, 'topic, 'qos, T>
impl<'domain, 'participant, 'topic, 'qos, T> RefUnwindSafe for WriterBuilder<'domain, 'participant, 'topic, 'qos, T>where
T: RefUnwindSafe,
impl<'domain, 'participant, 'topic, 'qos, T> Unpin for WriterBuilder<'domain, 'participant, 'topic, 'qos, T>
impl<'domain, 'participant, 'topic, 'qos, T> UnsafeUnpin for WriterBuilder<'domain, 'participant, 'topic, 'qos, T>
impl<'domain, 'participant, 'topic, 'qos, T> UnwindSafe for WriterBuilder<'domain, 'participant, 'topic, 'qos, T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more