pub struct Client(/* private fields */);
Expand description
Represents a connection to an FDomain.
The client is constructed by passing it a transport object which represents
the raw connection to the remote FDomain. The Client
wrapper then allows
us to construct and use handles which behave similarly to their counterparts
on a Fuchsia device.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(
transport: impl FDomainTransport + 'static,
) -> (Arc<Self>, impl Future<Output = ()> + Send + 'static)
pub fn new( transport: impl FDomainTransport + 'static, ) -> (Arc<Self>, impl Future<Output = ()> + Send + 'static)
Create a new FDomain client. The transport
argument should contain the
established connection to the target, ready to communicate the FDomain
protocol.
The second return item is a future that must be polled to keep transactions running.
Sourcepub async fn namespace(self: &Arc<Self>) -> Result<Channel, Error>
pub async fn namespace(self: &Arc<Self>) -> Result<Channel, Error>
Get the namespace for the connected FDomain. Calling this more than once is an error.
Sourcepub fn create_channel(self: &Arc<Self>) -> (Channel, Channel)
pub fn create_channel(self: &Arc<Self>) -> (Channel, Channel)
Create a new channel in the connected FDomain.
Sourcepub fn create_endpoints<F: ProtocolMarker>(
self: &Arc<Self>,
) -> (ClientEnd<F>, ServerEnd<F>)
pub fn create_endpoints<F: ProtocolMarker>( self: &Arc<Self>, ) -> (ClientEnd<F>, ServerEnd<F>)
Creates client and server endpoints connected to by a channel.
Sourcepub fn create_proxy<F: ProtocolMarker>(
self: &Arc<Self>,
) -> (F::Proxy, ServerEnd<F>)
pub fn create_proxy<F: ProtocolMarker>( self: &Arc<Self>, ) -> (F::Proxy, ServerEnd<F>)
Creates a client proxy and a server endpoint connected by a channel.
Sourcepub fn create_proxy_and_stream<F: ProtocolMarker>(
self: &Arc<Self>,
) -> (F::Proxy, F::RequestStream)
pub fn create_proxy_and_stream<F: ProtocolMarker>( self: &Arc<Self>, ) -> (F::Proxy, F::RequestStream)
Creates a client proxy and a server request stream connected by a channel.
Sourcepub fn create_stream_socket(self: &Arc<Self>) -> (Socket, Socket)
pub fn create_stream_socket(self: &Arc<Self>) -> (Socket, Socket)
Create a new streaming socket in the connected FDomain.
Sourcepub fn create_datagram_socket(self: &Arc<Self>) -> (Socket, Socket)
pub fn create_datagram_socket(self: &Arc<Self>) -> (Socket, Socket)
Create a new datagram socket in the connected FDomain.
Sourcepub fn create_event_pair(self: &Arc<Self>) -> (EventPair, EventPair)
pub fn create_event_pair(self: &Arc<Self>) -> (EventPair, EventPair)
Create a new event pair in the connected FDomain.
Sourcepub fn create_event(self: &Arc<Self>) -> Event
pub fn create_event(self: &Arc<Self>) -> Event
Create a new event handle in the connected FDomain.
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T
to [Self
]