pub enum BusRequest {
Publish {
data: Event,
control_handle: BusControlHandle,
},
EnsurePublish {
data: Event,
responder: BusEnsurePublishResponder,
},
GetClients {
responder: BusGetClientsResponder,
},
WaitForClients {
clients: Vec<String>,
timeout: i64,
responder: BusWaitForClientsResponder,
},
WaitForEvent_ {
data: Event,
timeout: i64,
responder: BusWaitForEvent_Responder,
},
}
Expand description
Represents a named bus: a bus is a broadcast pub/sub network that distributes Events. Events are not stored, only forwarded to attached clients.
Variants§
Publish
Publishes event on the bus.
EnsurePublish
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.
GetClients
Get list of named clients.
Fields
responder: BusGetClientsResponder
WaitForClients
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.
WaitForEvent_
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.
Implementations§
Source§impl BusRequest
impl BusRequest
pub fn into_publish(self) -> Option<(Event, BusControlHandle)>
pub fn into_ensure_publish(self) -> Option<(Event, BusEnsurePublishResponder)>
pub fn into_get_clients(self) -> Option<BusGetClientsResponder>
pub fn into_wait_for_clients( self, ) -> Option<(Vec<String>, i64, BusWaitForClientsResponder)>
pub fn into_wait_for_event_( self, ) -> Option<(Event, i64, BusWaitForEvent_Responder)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL