pub struct AdvertisedPeripheralSynchronousProxy { /* private fields */ }
Implementations§
Source§impl AdvertisedPeripheralSynchronousProxy
impl AdvertisedPeripheralSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<AdvertisedPeripheralEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<AdvertisedPeripheralEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn on_connected(
&self,
peer: &Peer,
connection: ClientEnd<ConnectionMarker>,
___deadline: MonotonicInstant,
) -> Result<(), Error>
pub fn on_connected( &self, peer: &Peer, connection: ClientEnd<ConnectionMarker>, ___deadline: MonotonicInstant, ) -> Result<(), Error>
Called when a remote LE central connects to this peripheral when
connectable advertising is enabled via
[fuchsia.bluetooth.le/Peripheral.Advertise
]. When this call is made,
the system has paused advertising, and will not continue until it
receives a response.
The returned [fuchsia.bluetooth.le/Connection
] protocol can be used to
interact with the peer. It also represents a peripheral’s ownership over
the connection: the client can drop the protocol to request a
disconnection. Similarly, the protocol is closed by the system to
indicate that the connection to the peer has been lost.
- request
peer
Information about the central that initiated the connection. - request
connection
Represents the connection.
- response An empty response should be sent to acknowledge the connection and resume advertising (for flow control).
Trait Implementations§
Source§impl SynchronousProxy for AdvertisedPeripheralSynchronousProxy
impl SynchronousProxy for AdvertisedPeripheralSynchronousProxy
Source§type Proxy = AdvertisedPeripheralProxy
type Proxy = AdvertisedPeripheralProxy
The async proxy for the same protocol.
Source§type Protocol = AdvertisedPeripheralMarker
type Protocol = AdvertisedPeripheralMarker
The protocol which this
Proxy
controls.Source§fn from_channel(inner: Channel) -> Self
fn from_channel(inner: Channel) -> Self
Create a proxy over the given channel.
Source§fn into_channel(self) -> Channel
fn into_channel(self) -> Channel
Convert the proxy back into a channel.
Source§fn as_channel(&self) -> &Channel
fn as_channel(&self) -> &Channel
Get a reference to the proxy’s underlying channel. Read more
Auto Trait Implementations§
impl Freeze for AdvertisedPeripheralSynchronousProxy
impl RefUnwindSafe for AdvertisedPeripheralSynchronousProxy
impl Send for AdvertisedPeripheralSynchronousProxy
impl Sync for AdvertisedPeripheralSynchronousProxy
impl Unpin for AdvertisedPeripheralSynchronousProxy
impl UnwindSafe for AdvertisedPeripheralSynchronousProxy
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