pub enum SocketRequest {
Show 36 variants Clone2 { request: ServerEnd<CloneableMarker>, control_handle: SocketControlHandle, }, Close { responder: SocketCloseResponder, }, Query { responder: SocketQueryResponder, }, SetReuseAddress { value: bool, responder: SocketSetReuseAddressResponder, }, GetReuseAddress { responder: SocketGetReuseAddressResponder, }, GetError { responder: SocketGetErrorResponder, }, SetBroadcast { value: bool, responder: SocketSetBroadcastResponder, }, GetBroadcast { responder: SocketGetBroadcastResponder, }, SetSendBuffer { value_bytes: u64, responder: SocketSetSendBufferResponder, }, GetSendBuffer { responder: SocketGetSendBufferResponder, }, SetReceiveBuffer { value_bytes: u64, responder: SocketSetReceiveBufferResponder, }, GetReceiveBuffer { responder: SocketGetReceiveBufferResponder, }, SetKeepAlive { value: bool, responder: SocketSetKeepAliveResponder, }, GetKeepAlive { responder: SocketGetKeepAliveResponder, }, SetOutOfBandInline { value: bool, responder: SocketSetOutOfBandInlineResponder, }, GetOutOfBandInline { responder: SocketGetOutOfBandInlineResponder, }, SetNoCheck { value: bool, responder: SocketSetNoCheckResponder, }, GetNoCheck { responder: SocketGetNoCheckResponder, }, SetLinger { linger: bool, length_secs: u32, responder: SocketSetLingerResponder, }, GetLinger { responder: SocketGetLingerResponder, }, SetReusePort { value: bool, responder: SocketSetReusePortResponder, }, GetReusePort { responder: SocketGetReusePortResponder, }, GetAcceptConn { responder: SocketGetAcceptConnResponder, }, SetBindToDevice { value: String, responder: SocketSetBindToDeviceResponder, }, GetBindToDevice { responder: SocketGetBindToDeviceResponder, }, SetBindToInterfaceIndex { value: u64, responder: SocketSetBindToInterfaceIndexResponder, }, GetBindToInterfaceIndex { responder: SocketGetBindToInterfaceIndexResponder, }, SetTimestamp { value: TimestampOption, responder: SocketSetTimestampResponder, }, GetTimestamp { responder: SocketGetTimestampResponder, }, SetMark { domain: MarkDomain, mark: OptionalUint32, responder: SocketSetMarkResponder, }, GetMark { domain: MarkDomain, responder: SocketGetMarkResponder, }, Describe { responder: SocketDescribeResponder, }, Bind { protocol: Option<Box<ProtocolAssociation>>, bound_interface_id: BoundInterfaceId, responder: SocketBindResponder, }, GetInfo { responder: SocketGetInfoResponder, }, RecvMsg { want_packet_info: bool, data_len: u32, want_control: bool, flags: RecvMsgFlags, responder: SocketRecvMsgResponder, }, SendMsg { packet_info: Option<Box<PacketInfo>>, data: Vec<u8>, control: SendControlData, flags: SendMsgFlags, responder: SocketSendMsgResponder, },
}
Expand description

A packet socket.

This interface is essentially POSIX.

All methods on this type are nonblocking; their exact behaviors match their Linux counterparts.

Warning: This protocol is not yet ready for direct use by clients. Instead, clients should use the BSD sockets API to interact with sockets. We plan to change this protocol substantially and clients that couple directly to this protocol will make those changes more difficult.

Variants§

§

Clone2

Fields

§request: ServerEnd<CloneableMarker>
§control_handle: SocketControlHandle
§

Close

Terminates the connection.

After calling Close, the client must not send any other requests.

Servers, after sending the status response, should close the connection regardless of status and without sending an epitaph.

Closing the client end of the channel should be semantically equivalent to calling Close without knowing when the close has completed or its status.

Fields

§

Query

Fields

§

SetReuseAddress

Set SOL_SOCKET -> SO_REUSEADDR.

§

GetReuseAddress

Get SOL_SOCKET -> SO_REUSEADDR.

§

GetError

Get SOL_SOCKET -> SO_ERROR. Returns the last error if there is an error set on the socket.

Fields

§

SetBroadcast

Set SOL_SOCKET -> SO_BROADCAST.

Fields

§value: bool
§

GetBroadcast

Get SOL_SOCKET -> SO_BROADCAST.

§

SetSendBuffer

Set SOL_SOCKET -> SO_SNDBUF.

Fields

§value_bytes: u64
§

GetSendBuffer

Get SOL_SOCKET -> SO_SNDBUF.

§

SetReceiveBuffer

Set SOL_SOCKET -> SO_RCVBUF.

Fields

§value_bytes: u64
§

GetReceiveBuffer

Get SOL_SOCKET -> SO_RCVBUF.

§

SetKeepAlive

Set SOL_SOCKET -> SO_KEEPALIVE.

Fields

§value: bool
§

GetKeepAlive

Get SOL_SOCKET -> SO_KEEPALIVE.

§

SetOutOfBandInline

Set SOL_SOCKET -> SO_OOBINLINE.

§

GetOutOfBandInline

Get SOL_SOCKET -> SO_OOBINLINE.

§

SetNoCheck

Set SOL_SOCKET -> SO_NO_CHECK.

Fields

§value: bool
§

GetNoCheck

Get SOL_SOCKET -> SO_NO_CHECK.

§

SetLinger

Set SOL_SOCKET -> SO_LINGER.

Fields

§linger: bool
§length_secs: u32
§

GetLinger

Get SOL_SOCKET -> SO_LINGER.

§

SetReusePort

Set SOL_SOCKET -> SO_REUSEPORT.

Fields

§value: bool
§

GetReusePort

Get SOL_SOCKET -> SO_REUSEPORT.

§

GetAcceptConn

Get SOL_SOCKET -> SO_ACCEPTCONN.

§

SetBindToDevice

Set SOL_SOCKET -> SO_BINDTODEVICE.

§

GetBindToDevice

Get SOL_SOCKET -> SO_BINDTODEVICE.

§

SetBindToInterfaceIndex

Set SOL_SOCKET -> SO_BINDTOIFINDEX. If value is 0, this clears the bound interface.

§

GetBindToInterfaceIndex

Get SOL_SOCKET -> SO_BINDTOIFINDEX.

§

SetTimestamp

Set SOL_SOCKET -> SO_TIMESTAMP or SO_TIMESTAMPNS.

Fields

§value: TimestampOption
§

GetTimestamp

Get SOL_SOCKET -> SO_TIMESTAMP or SO_TIMESTAMPNS.

§

SetMark

Like setting SOL_SOCKET -> SO_MARK. The major difference is that unlike the standard SO_MARK, this API has multiple mark domains and each mark can be set independently in each domain.

Fields

§domain: MarkDomain
§mark: OptionalUint32
§

GetMark

Like getting SOL_SOCKET -> SO_MARK. The major difference is that unlike the standard SO_MARK, this API has multiple mark domains and each mark can be retrieved independently in each domain.

Fields

§domain: MarkDomain
§

Describe

Fields

§

Bind

Bind the socket to a protocol and/or interface.

  • request protocol the socket’s new protocol association.
  • request bound_interface_id the socket’s new interface binding.

Fields

§bound_interface_id: BoundInterfaceId
§

GetInfo

Returns the the socket’s properties.

  • response kind the socket’s Kind.
  • response protocol the socket’s protocol association, if associated.
  • response bound_interface properties of the socket’s interface binding.

Fields

§

RecvMsg

Receives a message from the socket.

  • request want_packet_info request information about the packet to be returned.
  • request data_len the maximum allowed length of the response data buffer.
  • request want_control request ancillary data to be returned.
  • request flags flags for the receive request.
  • response packet_info information about the packet, if requested.
  • response data the message.
  • response control control messages, if requested.
  • response truncated indicates whether or not the returned message was truncated.

Fields

§want_packet_info: bool
§data_len: u32
§want_control: bool
§flags: RecvMsgFlags
§

SendMsg

Sends a message on the socket.

  • request packet_info information about the packet.
  • request data the message.
  • request control ancillary data.
  • request flags flags for the send request.

Fields

§packet_info: Option<Box<PacketInfo>>
§data: Vec<u8>
§flags: SendMsgFlags

Implementations§

source§

impl SocketRequest

source

pub fn into_clone2( self ) -> Option<(ServerEnd<CloneableMarker>, SocketControlHandle)>

source

pub fn into_close(self) -> Option<SocketCloseResponder>

source

pub fn into_query(self) -> Option<SocketQueryResponder>

source

pub fn into_set_reuse_address( self ) -> Option<(bool, SocketSetReuseAddressResponder)>

source

pub fn into_get_reuse_address(self) -> Option<SocketGetReuseAddressResponder>

source

pub fn into_get_error(self) -> Option<SocketGetErrorResponder>

source

pub fn into_set_broadcast(self) -> Option<(bool, SocketSetBroadcastResponder)>

source

pub fn into_get_broadcast(self) -> Option<SocketGetBroadcastResponder>

source

pub fn into_set_send_buffer(self) -> Option<(u64, SocketSetSendBufferResponder)>

source

pub fn into_get_send_buffer(self) -> Option<SocketGetSendBufferResponder>

source

pub fn into_set_receive_buffer( self ) -> Option<(u64, SocketSetReceiveBufferResponder)>

source

pub fn into_get_receive_buffer(self) -> Option<SocketGetReceiveBufferResponder>

source

pub fn into_set_keep_alive(self) -> Option<(bool, SocketSetKeepAliveResponder)>

source

pub fn into_get_keep_alive(self) -> Option<SocketGetKeepAliveResponder>

source

pub fn into_set_out_of_band_inline( self ) -> Option<(bool, SocketSetOutOfBandInlineResponder)>

source

pub fn into_get_out_of_band_inline( self ) -> Option<SocketGetOutOfBandInlineResponder>

source

pub fn into_set_no_check(self) -> Option<(bool, SocketSetNoCheckResponder)>

source

pub fn into_get_no_check(self) -> Option<SocketGetNoCheckResponder>

source

pub fn into_set_linger(self) -> Option<(bool, u32, SocketSetLingerResponder)>

source

pub fn into_get_linger(self) -> Option<SocketGetLingerResponder>

source

pub fn into_set_reuse_port(self) -> Option<(bool, SocketSetReusePortResponder)>

source

pub fn into_get_reuse_port(self) -> Option<SocketGetReusePortResponder>

source

pub fn into_get_accept_conn(self) -> Option<SocketGetAcceptConnResponder>

source

pub fn into_set_bind_to_device( self ) -> Option<(String, SocketSetBindToDeviceResponder)>

source

pub fn into_get_bind_to_device(self) -> Option<SocketGetBindToDeviceResponder>

source

pub fn into_set_bind_to_interface_index( self ) -> Option<(u64, SocketSetBindToInterfaceIndexResponder)>

source

pub fn into_get_bind_to_interface_index( self ) -> Option<SocketGetBindToInterfaceIndexResponder>

source

pub fn into_set_timestamp( self ) -> Option<(TimestampOption, SocketSetTimestampResponder)>

source

pub fn into_get_timestamp(self) -> Option<SocketGetTimestampResponder>

source

pub fn into_set_mark( self ) -> Option<(MarkDomain, OptionalUint32, SocketSetMarkResponder)>

source

pub fn into_get_mark(self) -> Option<(MarkDomain, SocketGetMarkResponder)>

source

pub fn into_describe(self) -> Option<SocketDescribeResponder>

source

pub fn into_bind( self ) -> Option<(Option<Box<ProtocolAssociation>>, BoundInterfaceId, SocketBindResponder)>

source

pub fn into_get_info(self) -> Option<SocketGetInfoResponder>

source

pub fn into_recv_msg( self ) -> Option<(bool, u32, bool, RecvMsgFlags, SocketRecvMsgResponder)>

source

pub fn into_send_msg( self ) -> Option<(Option<Box<PacketInfo>>, Vec<u8>, SendControlData, SendMsgFlags, SocketSendMsgResponder)>

source

pub fn method_name(&self) -> &'static str

Name of the method defined in FIDL

Trait Implementations§

source§

impl Debug for SocketRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Encode<Ambiguous1> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T> Encode<Ambiguous2> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more