pub struct ReaderBuilder<'domain, 'participant, 'topic, 'qos, T>where
T: Topicable,{ /* private fields */ }Expand description
Builder for Reader<T> (accessible via Reader::builder).
Implementations§
Source§impl<'d, 'p, 't, 'q, T> ReaderBuilder<'d, 'p, 't, 'q, T>where
T: Topicable,
impl<'d, 'p, 't, 'q, T> ReaderBuilder<'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 ReaderBuilder for the given Topic.
§Examples
use cyclonedds::builder::ReaderBuilder;
use cyclonedds::{Domain, Participant, Topic};
let domain = Domain::default();
let participant = Participant::new(&domain)?;
let topic = Topic::new(&participant, "MyTopic")?;
let reader_builder = ReaderBuilder::<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 reader builder.
§Examples
use cyclonedds::builder::ReaderBuilder;
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 reader_builder = ReaderBuilder::<Data>::new(&topic).with_qos(&qos);Sourcepub const fn with_subscriber(self, subscriber: &'p Subscriber<'d, 'p>) -> Self
pub const fn with_subscriber(self, subscriber: &'p Subscriber<'d, 'p>) -> Self
Sets the Subscriber on this reader builder.
§Examples
use cyclonedds::ReaderListener;
use cyclonedds::Subscriber;
use cyclonedds::builder::ReaderBuilder;
let subscriber = Subscriber::new(&participant)?;
let reader_builder = ReaderBuilder::<Data>::new(&topic).with_subscriber(&subscriber);Sourcepub fn with_listener<L>(self, listener: L) -> Selfwhere
L: AsRef<ReaderListener<T>>,
pub fn with_listener<L>(self, listener: L) -> Selfwhere
L: AsRef<ReaderListener<T>>,
Sourcepub fn build(self) -> Result<Reader<'d, 'p, 't, T>>
pub fn build(self) -> Result<Reader<'d, 'p, 't, T>>
Builds the Reader.
§Errors
Returns an Error if the reader failed to create.
§Examples
use cyclonedds::QoS;
use cyclonedds::builder::ReaderBuilder;
use cyclonedds::qos::policy;
let qos = QoS::new().with_durability(policy::Durability::TransientLocal);
let reader = ReaderBuilder::<Data>::new(&topic).with_qos(&qos).build()?;Trait Implementations§
Auto Trait Implementations§
impl<'domain, 'participant, 'topic, 'qos, T> !Send for ReaderBuilder<'domain, 'participant, 'topic, 'qos, T>
impl<'domain, 'participant, 'topic, 'qos, T> !Sync for ReaderBuilder<'domain, 'participant, 'topic, 'qos, T>
impl<'domain, 'participant, 'topic, 'qos, T> Freeze for ReaderBuilder<'domain, 'participant, 'topic, 'qos, T>
impl<'domain, 'participant, 'topic, 'qos, T> RefUnwindSafe for ReaderBuilder<'domain, 'participant, 'topic, 'qos, T>where
T: RefUnwindSafe,
impl<'domain, 'participant, 'topic, 'qos, T> Unpin for ReaderBuilder<'domain, 'participant, 'topic, 'qos, T>
impl<'domain, 'participant, 'topic, 'qos, T> UnsafeUnpin for ReaderBuilder<'domain, 'participant, 'topic, 'qos, T>
impl<'domain, 'participant, 'topic, 'qos, T> UnwindSafe for ReaderBuilder<'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