pub struct BusProxy { /* private fields */ }
Implementations§
Source§impl BusProxy
impl BusProxy
Sourcepub fn take_event_stream(&self) -> BusEventStream
pub fn take_event_stream(&self) -> BusEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn ensure_publish(
&self,
data: &Event,
) -> QueryResponseFut<(), DefaultFuchsiaResourceDialect>
pub fn ensure_publish( &self, data: &Event, ) -> QueryResponseFut<(), DefaultFuchsiaResourceDialect>
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,
) -> QueryResponseFut<Vec<String>, DefaultFuchsiaResourceDialect>
pub fn get_clients( &self, ) -> QueryResponseFut<Vec<String>, DefaultFuchsiaResourceDialect>
Get list of named clients.
Sourcepub fn wait_for_clients(
&self,
clients: &[String],
timeout: i64,
) -> QueryResponseFut<(bool, Option<Vec<String>>), DefaultFuchsiaResourceDialect>
pub fn wait_for_clients( &self, clients: &[String], timeout: i64, ) -> QueryResponseFut<(bool, Option<Vec<String>>), DefaultFuchsiaResourceDialect>
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,
) -> QueryResponseFut<bool, DefaultFuchsiaResourceDialect>
pub fn wait_for_event_( &self, data: &Event, timeout: i64, ) -> QueryResponseFut<bool, DefaultFuchsiaResourceDialect>
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.
Trait Implementations§
Source§impl BusProxyInterface for BusProxy
impl BusProxyInterface for BusProxy
type EnsurePublishResponseFut = QueryResponseFut<()>
type GetClientsResponseFut = QueryResponseFut<Vec<String>>
type WaitForClientsResponseFut = QueryResponseFut<(bool, Option<Vec<String>>)>
type WaitForEvent_ResponseFut = QueryResponseFut<bool>
fn publish(&self, data: &Event) -> Result<(), Error>
fn ensure_publish(&self, data: &Event) -> Self::EnsurePublishResponseFut
fn get_clients(&self) -> Self::GetClientsResponseFut
fn wait_for_clients( &self, clients: &[String], timeout: i64, ) -> Self::WaitForClientsResponseFut
fn wait_for_event_( &self, data: &Event, timeout: i64, ) -> Self::WaitForEvent_ResponseFut
Source§impl Proxy for BusProxy
impl Proxy for BusProxy
Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Auto Trait Implementations§
impl Freeze for BusProxy
impl !RefUnwindSafe for BusProxy
impl Send for BusProxy
impl Sync for BusProxy
impl Unpin for BusProxy
impl !UnwindSafe for BusProxy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)