pub enum ScoConnectionRequest {
Read {
responder: ScoConnectionReadResponder,
},
Write {
payload: ScoConnectionWriteRequest,
responder: ScoConnectionWriteResponder,
},
RequestDisconnect {
control_handle: ScoConnectionControlHandle,
},
#[non_exhaustive] _UnknownMethod {
ordinal: u64,
control_handle: ScoConnectionControlHandle,
method_type: MethodType,
},
}
Expand description
A SCO connection. The connection is pending until the OnConnectionComplete
event is sent,
which will always arrive first. If the connection fails, the protocol will be closed after the
error is delivered. If methods are called before the OnConnectionComplete
event, they will
fail, the protocol will be closed, and any connection will be dropped.
Variants§
Read
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.
Fields
responder: ScoConnectionReadResponder
Write
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.
RequestDisconnect
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.
Fields
control_handle: ScoConnectionControlHandle
#[non_exhaustive]_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
control_handle: ScoConnectionControlHandle
method_type: MethodType
Implementations§
Source§impl ScoConnectionRequest
impl ScoConnectionRequest
pub fn into_read(self) -> Option<ScoConnectionReadResponder>
pub fn into_write( self, ) -> Option<(ScoConnectionWriteRequest, ScoConnectionWriteResponder)>
pub fn into_request_disconnect(self) -> Option<ScoConnectionControlHandle>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL