pub struct BusSynchronousProxy { /* private fields */ }
Implementations§
Source§impl BusSynchronousProxy
impl BusSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<BusEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<BusEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn ensure_publish(
&self,
data: &Event,
___deadline: MonotonicInstant,
) -> Result<(), Error>
pub fn ensure_publish( &self, data: &Event, ___deadline: MonotonicInstant, ) -> Result<(), Error>
Publishes data on bus and only returns when data has been dispatched. Use this if you need guarantees that the data was broadcast before continuing. Note that this ensures that the data will be published to all listening clients, but it cannot guarantee that all clients will have observed the event before it returns.
Sourcepub fn get_clients(
&self,
___deadline: MonotonicInstant,
) -> Result<Vec<String>, Error>
pub fn get_clients( &self, ___deadline: MonotonicInstant, ) -> Result<Vec<String>, Error>
Get list of named clients.
Sourcepub fn wait_for_clients(
&self,
clients: &[String],
timeout: i64,
___deadline: MonotonicInstant,
) -> Result<(bool, Option<Vec<String>>), Error>
pub fn wait_for_clients( &self, clients: &[String], timeout: i64, ___deadline: MonotonicInstant, ) -> Result<(bool, Option<Vec<String>>), Error>
Waits for up to timeout
(nsec) for all the clients in clients
.
Returns true if all clients are present on the bus before timeout expired.
If result
is false, absent
will contain the entries in clients
that still weren’t
present on the bus when the timout expired.
Use timeout
<= 0 for indefinite wait.
Sourcepub fn wait_for_event_(
&self,
data: &Event,
timeout: i64,
___deadline: MonotonicInstant,
) -> Result<bool, Error>
pub fn wait_for_event_( &self, data: &Event, timeout: i64, ___deadline: MonotonicInstant, ) -> Result<bool, Error>
Waits for up to timeout
(nsec) for an event that matches data
.
Event equality is performed by comparing all set fields in data
.
Returns true if event was received before timeout expired.
Use timeout
<= 0 for indefinite wait.