pub struct Client { /* private fields */ }
Expand description
A synchronous client for making FIDL calls.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(channel: Channel, protocol_name: &'static str) -> Self
pub fn new(channel: Channel, protocol_name: &'static str) -> Self
Create a new synchronous FIDL client.
Sourcepub fn as_channel(&self) -> &Channel
pub fn as_channel(&self) -> &Channel
Return a reference to the underlying channel for the client.
Sourcepub fn into_channel(self) -> Channel
pub fn into_channel(self) -> Channel
Get the underlying channel out of the client.
Sourcepub fn send<T: TypeMarker>(
&self,
body: impl Encode<T, DefaultFuchsiaResourceDialect>,
ordinal: u64,
dynamic_flags: DynamicFlags,
) -> Result<(), Error>
pub fn send<T: TypeMarker>( &self, body: impl Encode<T, DefaultFuchsiaResourceDialect>, ordinal: u64, dynamic_flags: DynamicFlags, ) -> Result<(), Error>
Send a new message.
Sourcepub fn send_query<Request: TypeMarker, Response: TypeMarker>(
&self,
body: impl Encode<Request, DefaultFuchsiaResourceDialect>,
ordinal: u64,
dynamic_flags: DynamicFlags,
deadline: MonotonicInstant,
) -> Result<Response::Owned, Error>
pub fn send_query<Request: TypeMarker, Response: TypeMarker>( &self, body: impl Encode<Request, DefaultFuchsiaResourceDialect>, ordinal: u64, dynamic_flags: DynamicFlags, deadline: MonotonicInstant, ) -> Result<Response::Owned, Error>
Send a new message expecting a response.
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<MessageBufEtc, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<MessageBufEtc, Error>
Wait for an event to arrive on the underlying channel.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
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
Mutably borrows from an owned value. Read more