pub enum SocketRequest {
CreateSocket {
options: SocketType,
handles: [NewHandleId; 2],
responder: SocketCreateSocketResponder,
},
SetSocketDisposition {
handle: HandleId,
disposition: SocketDisposition,
disposition_peer: SocketDisposition,
responder: SocketSetSocketDispositionResponder,
},
ReadSocket {
handle: HandleId,
max_bytes: u64,
responder: SocketReadSocketResponder,
},
WriteSocket {
handle: HandleId,
data: Vec<u8>,
responder: SocketWriteSocketResponder,
},
ReadSocketStreamingStart {
handle: HandleId,
responder: SocketReadSocketStreamingStartResponder,
},
ReadSocketStreamingStop {
handle: HandleId,
responder: SocketReadSocketStreamingStopResponder,
},
#[non_exhaustive] _UnknownMethod {
ordinal: u64,
control_handle: SocketControlHandle,
method_type: MethodType,
},
}Expand description
FDomain operations on sockets
Variants§
CreateSocket
Create a new socket in this FDomain and return both its ends.
SetSocketDisposition
Set the disposition of a given socket.
Fields
disposition: SocketDispositiondisposition_peer: SocketDispositionresponder: SocketSetSocketDispositionResponderReadSocket
Read data from a socket. This method will fail if the socket is currently being read asynchronously.
WriteSocket
Write to a socket. This will attempt to write all the data passed, and
will block and retry whenever it is safe (e.g. it should never return
SHOULD_WAIT). The WriteSocketError contains a wrote parameter to
indicate if some bytes were written successfully before the failure
occurred.
ReadSocketStreamingStart
Starts reading from the given socket. Data is returned via the SocketStreamingData event. That
event will occur repeatedly until ReadSocketStreamingStop is called for the same handle or the
event indicates the handle is closed.
ReadSocketStreamingStop
Stop asynchronous reading from the given socket.
#[non_exhaustive]_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
control_handle: SocketControlHandlemethod_type: MethodTypeImplementations§
Source§impl SocketRequest
impl SocketRequest
pub fn into_create_socket( self, ) -> Option<(SocketType, [NewHandleId; 2], SocketCreateSocketResponder)>
pub fn into_set_socket_disposition( self, ) -> Option<(HandleId, SocketDisposition, SocketDisposition, SocketSetSocketDispositionResponder)>
pub fn into_read_socket( self, ) -> Option<(HandleId, u64, SocketReadSocketResponder)>
pub fn into_write_socket( self, ) -> Option<(HandleId, Vec<u8>, SocketWriteSocketResponder)>
pub fn into_read_socket_streaming_start( self, ) -> Option<(HandleId, SocketReadSocketStreamingStartResponder)>
pub fn into_read_socket_streaming_stop( self, ) -> Option<(HandleId, SocketReadSocketStreamingStopResponder)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL