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>
impl<Req: TopicType + 'static, Rep: TopicType + 'static> Replier<Req, Rep>
Sourcepub fn new(participant: &DomainParticipant, service: &str) -> Result<Self>
pub fn new(participant: &DomainParticipant, service: &str) -> Result<Self>
A replier of the service service, on its default topics.
Sourcepub fn with_config(
participant: &DomainParticipant,
config: &RpcConfig,
) -> Result<Self>
pub fn with_config( participant: &DomainParticipant, config: &RpcConfig, ) -> Result<Self>
A replier made as config says.
Source§impl<Req, Rep> Replier<Req, Rep>
impl<Req, Rep> Replier<Req, Rep>
Sourcepub fn basic(
participant: &DomainParticipant,
config: &RpcConfig,
) -> Result<Self>
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>
impl<Req, Rep> Replier<Req, Rep>
Sourcepub fn with_topics(
participant: &DomainParticipant,
request: &Topic<Req>,
reply: &Topic<Rep>,
config: &RpcConfig,
) -> Result<Self>
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).
Sourcepub fn request_datareader(&self) -> &DataReader<Req>
pub fn request_datareader(&self) -> &DataReader<Req>
The reader of the requests.
Sourcepub fn reply_datawriter(&self) -> &DataWriter<Rep>
pub fn reply_datawriter(&self) -> &DataWriter<Rep>
The writer of the replies.
Sourcepub fn take_requests(&self) -> Result<Vec<Request<Req>>>
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.
Sourcepub fn receive_requests(&self, timeout: Duration) -> Result<Vec<Request<Req>>>
pub fn receive_requests(&self, timeout: Duration) -> Result<Vec<Request<Req>>>
Waits for requests and takes them; an empty list when timeout
passes first.
Sourcepub fn send_reply(&self, reply: &Rep, request: &SampleIdentity) -> Result<()>
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.