pub struct ClientProxy { /* private fields */ }
Implementations§
Source§impl ClientProxy
impl ClientProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.bluetooth.gatt2/Client.
Sourcepub fn take_event_stream(&self) -> ClientEventStream
pub fn take_event_stream(&self) -> ClientEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn watch_services(
&self,
uuids: &[Uuid],
) -> QueryResponseFut<(Vec<ServiceInfo>, Vec<Handle>), DefaultFuchsiaResourceDialect>
pub fn watch_services( &self, uuids: &[Uuid], ) -> QueryResponseFut<(Vec<ServiceInfo>, Vec<Handle>), DefaultFuchsiaResourceDialect>
Enumerates services found on the peer that this Client represents.
Results can be filtered by specifying a list of UUIDs in uuids
. This
method follows the hanging get pattern. On the initial request, a
complete snapshot will be returned. Subsequent calls with the same set
of uuids
receive a response only when one or more services have been
added, modified, or removed from the entries reported since the most
recent call. Calls with new values of uuids
will reset the filter and
receive a complete snapshot.
Handles may be reused across services, so a handle may be in both
updated
and removed
. For this reason, it is recommended to process
removed services before updated services.
To further interact with services, clients must obtain a RemoteService protocol by calling ConnectToService().
- request
uuids
the UUID allowlist. If empty, all services will be returned.
- response
updated
the services that have been added or modified since WatchServices() was last called. The returned ServiceInfo tables will contain only basic information about each service and thecharacteristics
andincludes
fields will be null. If a service has been added/modified and then removed since the last call, it will only be present inremoved
, notupdated
. If concluded due to a new call with a newuuids
value,updated
will be empty. - response
removed
the handles of the services that have been removed since the last call to WatchServices().
Sourcepub fn connect_to_service(
&self,
handle: &ServiceHandle,
service: ServerEnd<RemoteServiceMarker>,
) -> Result<(), Error>
pub fn connect_to_service( &self, handle: &ServiceHandle, service: ServerEnd<RemoteServiceMarker>, ) -> Result<(), Error>
Connects the RemoteService with the given identifier. Only 1 connection per service is allowed.
service
will be closed on error, with an epitaph that provides a
reason.
- error Returns a
ZX_ERR_INVALID_ARGS
ifhandle
is invalid. - error Returns a
ZX_ERR_NOT_FOUND
if the service is not found. - error Returns a
ZX_ERR_CONNECTION_RESET
if the service is removed. - error Returns a
ZX_ERR_NOT_CONNECTED
if the peer disconnects. - error Returns a
ZX_ERR_ALREADY_EXISTS
if the service is already connected.
Trait Implementations§
Source§impl ClientProxyInterface for ClientProxy
impl ClientProxyInterface for ClientProxy
type WatchServicesResponseFut = QueryResponseFut<(Vec<ServiceInfo>, Vec<Handle>)>
fn watch_services(&self, uuids: &[Uuid]) -> Self::WatchServicesResponseFut
fn connect_to_service( &self, handle: &ServiceHandle, service: ServerEnd<RemoteServiceMarker>, ) -> Result<(), Error>
Source§impl Clone for ClientProxy
impl Clone for ClientProxy
Source§fn clone(&self) -> ClientProxy
fn clone(&self) -> ClientProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ClientProxy
impl Debug for ClientProxy
Source§impl Proxy for ClientProxy
impl Proxy for ClientProxy
Source§type Protocol = ClientMarker
type Protocol = ClientMarker
Proxy
controls.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 ClientProxy
impl !RefUnwindSafe for ClientProxy
impl Send for ClientProxy
impl Sync for ClientProxy
impl Unpin for ClientProxy
impl !UnwindSafe for ClientProxy
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
)