Skip to main content

Replier

Struct Replier 

Source
pub struct Replier<Req, Rep> { /* private fields */ }
Expand description

The service side: takes requests of type Req and answers each with replies of type Rep (DDS-RPC 1.0, 7.8.1).

Implementations§

Source§

impl<Req: TopicType + 'static, Rep: TopicType + 'static> Replier<Req, Rep>

Source

pub fn new(participant: &DomainParticipant, service: &str) -> Result<Self>

A replier of the service service, on its default topics.

Source

pub fn with_config( participant: &DomainParticipant, config: &RpcConfig, ) -> Result<Self>

A replier made as config says.

Source§

impl<Req, Rep> Replier<Req, Rep>
where Req: TopicType + BasicRequest + 'static, Rep: TopicType + BasicReply + Clone + 'static,

Source

pub fn basic( participant: &DomainParticipant, config: &RpcConfig, ) -> Result<Self>

A replier of the Basic Service Mapping (DDS-RPC 1.0, 7.5.1.1) made as config says: a request is known by the identity in its header, which send_reply writes in the header of the reply (its remote_ex is left as it is). With a service_instance_name, it drops the requests for another instance (a request with an empty instance name is for any).

Source§

impl<Req, Rep> Replier<Req, Rep>

Source

pub fn with_topics( participant: &DomainParticipant, request: &Topic<Req>, reply: &Topic<Rep>, config: &RpcConfig, ) -> Result<Self>

A replier on the topics given, of any sample type (such as DynamicData), with the QoS and the service instance name of config (its topic names are not used).

Source

pub fn request_datareader(&self) -> &DataReader<Req>

The reader of the requests.

Source

pub fn reply_datawriter(&self) -> &DataWriter<Rep>

The writer of the replies.

Source

pub fn take_requests(&self) -> Result<Vec<Request<Req>>>

Takes the requests come so far, in order of arrival, but those of a requester whose reply reader is not yet matched: they stay until it is.

Source

pub fn receive_requests(&self, timeout: Duration) -> Result<Vec<Request<Req>>>

Waits for requests and takes them; an empty list when timeout passes first.

Source

pub fn send_reply(&self, reply: &Rep, request: &SampleIdentity) -> Result<()>

Sends reply to the request request; with the request’s in-payload header at its head when it had one.

Trait Implementations§

Source§

impl<Req, Rep> Debug for Replier<Req, Rep>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Req, Rep> !Freeze for Replier<Req, Rep>

§

impl<Req, Rep> !RefUnwindSafe for Replier<Req, Rep>

§

impl<Req, Rep> !UnwindSafe for Replier<Req, Rep>

§

impl<Req, Rep> Forget for Replier<Req, Rep>

§

impl<Req, Rep> Move for Replier<Req, Rep>

§

impl<Req, Rep> Send for Replier<Req, Rep>
where Arc<Shared>: Send, Arc<dyn SampleType<Req>>: Send, Arc<dyn SampleType<Rep>>: Send, Arc<LoanCheck>: Send, Mutex<Vec<Request<Req>>>: Send, Mutex<HashMap<SampleIdentity, ([u8; 8], i64)>>: Send, RawVecInner: Send,

§

impl<Req, Rep> Sync for Replier<Req, Rep>
where Arc<Shared>: Sync, Arc<dyn SampleType<Req>>: Sync, Arc<dyn SampleType<Rep>>: Sync, Arc<LoanCheck>: Sync, Mutex<Vec<Request<Req>>>: Sync, Mutex<HashMap<SampleIdentity, ([u8; 8], i64)>>: Sync, RawVecInner: Sync,

§

impl<Req, Rep> Unpin for Replier<Req, Rep>
where Req: Unpin, Arc<Shared>: Unpin, Arc<dyn SampleType<Req>>: Unpin, Arc<dyn SampleType<Rep>>: Unpin, Arc<LoanCheck>: Unpin, Align4<u32>: Unpin, Align1<u8>: Unpin, *const u8 is !null: Unpin,

§

impl<Req, Rep> UnsafeUnpin for Replier<Req, Rep>
where *const ArcInner<Shared> is !null: UnsafeUnpin, PhantomData<ArcInner<Shared>>: UnsafeUnpin, *const ArcInner<dyn SampleType<Req>> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn SampleType<Req>>>: UnsafeUnpin, *const ArcInner<dyn SampleType<Rep>> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn SampleType<Rep>>>: UnsafeUnpin, *const ArcInner<LoanCheck> is !null: UnsafeUnpin, PhantomData<ArcInner<LoanCheck>>: UnsafeUnpin, Align4<u32>: UnsafeUnpin, Align1<u8>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<Request<Req>>: UnsafeUnpin, PhantomData<(SampleIdentity, ([u8; 8], i64))>: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.