pub struct ScoConnectionSynchronousProxy { /* private fields */ }
Implementations§
Source§impl ScoConnectionSynchronousProxy
impl ScoConnectionSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<ScoConnectionEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<ScoConnectionEvent, 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 read(
&self,
___deadline: MonotonicInstant,
) -> Result<ScoConnectionReadResponse, Error>
pub fn read( &self, ___deadline: MonotonicInstant, ) -> Result<ScoConnectionReadResponse, Error>
Read the next inbound SCO payload. Hangs until new data is received. Only one Read request may be pending at a time. Additional requests will result in protocol closure.
Sourcepub fn write(
&self,
payload: &ScoConnectionWriteRequest,
___deadline: MonotonicInstant,
) -> Result<(), Error>
pub fn write( &self, payload: &ScoConnectionWriteRequest, ___deadline: MonotonicInstant, ) -> Result<(), Error>
Write data
to the SCO connection.
If Write tries to send more data than max_tx_data_size
, the protocol will be closed.
Only one Write request may be pending at a time. Additional requests will result in protocol
closure.
Sourcepub fn request_disconnect(&self) -> Result<(), Error>
pub fn request_disconnect(&self) -> Result<(), Error>
Request disconnect of the current connection. The server is expected to close the protocol once the underlying connection is disconnected. This can be used to order events to happen after the connection is dropped. If this is not necessary, the server will always disconnect the SCO when this protocol is closed by the client.
Trait Implementations§
Source§impl From<Channel> for ScoConnectionSynchronousProxy
Available on Fuchsia only.
impl From<Channel> for ScoConnectionSynchronousProxy
Source§impl From<ScoConnectionSynchronousProxy> for Handle
Available on Fuchsia only.
impl From<ScoConnectionSynchronousProxy> for Handle
Source§fn from(value: ScoConnectionSynchronousProxy) -> Self
fn from(value: ScoConnectionSynchronousProxy) -> Self
Source§impl FromClient for ScoConnectionSynchronousProxy
Available on Fuchsia only.
impl FromClient for ScoConnectionSynchronousProxy
Source§type Protocol = ScoConnectionMarker
type Protocol = ScoConnectionMarker
Source§fn from_client(value: ClientEnd<ScoConnectionMarker>) -> Self
fn from_client(value: ClientEnd<ScoConnectionMarker>) -> Self
Source§impl SynchronousProxy for ScoConnectionSynchronousProxy
Available on Fuchsia only.
impl SynchronousProxy for ScoConnectionSynchronousProxy
Source§type Proxy = ScoConnectionProxy
type Proxy = ScoConnectionProxy
Source§type Protocol = ScoConnectionMarker
type Protocol = ScoConnectionMarker
Proxy
controls.