pub struct SocketProxy { /* private fields */ }

Implementations§

source§

impl SocketProxy

source

pub fn new(channel: AsyncChannel) -> Self

Create a new Proxy for fuchsia.posix.socket.packet/Socket.

source

pub fn take_event_stream(&self) -> SocketEventStream

Get a Stream of events from the remote end of the protocol.

§Panics

Panics if the event stream was already taken.

source

pub fn clone2(&self, request: ServerEnd<CloneableMarker>) -> Result<(), Error>

source

pub fn close(&self) -> QueryResponseFut<CloseableCloseResult>

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.

source

pub fn query(&self) -> QueryResponseFut<Vec<u8>>

source

pub fn set_reuse_address( &self, value: bool ) -> QueryResponseFut<BaseSocketSetReuseAddressResult>

Set SOL_SOCKET -> SO_REUSEADDR.

source

pub fn get_reuse_address( &self ) -> QueryResponseFut<BaseSocketGetReuseAddressResult>

Get SOL_SOCKET -> SO_REUSEADDR.

source

pub fn get_error(&self) -> QueryResponseFut<BaseSocketGetErrorResult>

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

source

pub fn set_broadcast( &self, value: bool ) -> QueryResponseFut<BaseSocketSetBroadcastResult>

Set SOL_SOCKET -> SO_BROADCAST.

source

pub fn get_broadcast(&self) -> QueryResponseFut<BaseSocketGetBroadcastResult>

Get SOL_SOCKET -> SO_BROADCAST.

source

pub fn set_send_buffer( &self, value_bytes: u64 ) -> QueryResponseFut<BaseSocketSetSendBufferResult>

Set SOL_SOCKET -> SO_SNDBUF.

source

pub fn get_send_buffer(&self) -> QueryResponseFut<BaseSocketGetSendBufferResult>

Get SOL_SOCKET -> SO_SNDBUF.

source

pub fn set_receive_buffer( &self, value_bytes: u64 ) -> QueryResponseFut<BaseSocketSetReceiveBufferResult>

Set SOL_SOCKET -> SO_RCVBUF.

source

pub fn get_receive_buffer( &self ) -> QueryResponseFut<BaseSocketGetReceiveBufferResult>

Get SOL_SOCKET -> SO_RCVBUF.

source

pub fn set_keep_alive( &self, value: bool ) -> QueryResponseFut<BaseSocketSetKeepAliveResult>

Set SOL_SOCKET -> SO_KEEPALIVE.

source

pub fn get_keep_alive(&self) -> QueryResponseFut<BaseSocketGetKeepAliveResult>

Get SOL_SOCKET -> SO_KEEPALIVE.

source

pub fn set_out_of_band_inline( &self, value: bool ) -> QueryResponseFut<BaseSocketSetOutOfBandInlineResult>

Set SOL_SOCKET -> SO_OOBINLINE.

source

pub fn get_out_of_band_inline( &self ) -> QueryResponseFut<BaseSocketGetOutOfBandInlineResult>

Get SOL_SOCKET -> SO_OOBINLINE.

source

pub fn set_no_check( &self, value: bool ) -> QueryResponseFut<BaseSocketSetNoCheckResult>

Set SOL_SOCKET -> SO_NO_CHECK.

source

pub fn get_no_check(&self) -> QueryResponseFut<BaseSocketGetNoCheckResult>

Get SOL_SOCKET -> SO_NO_CHECK.

source

pub fn set_linger( &self, linger: bool, length_secs: u32 ) -> QueryResponseFut<BaseSocketSetLingerResult>

Set SOL_SOCKET -> SO_LINGER.

source

pub fn get_linger(&self) -> QueryResponseFut<BaseSocketGetLingerResult>

Get SOL_SOCKET -> SO_LINGER.

source

pub fn set_reuse_port( &self, value: bool ) -> QueryResponseFut<BaseSocketSetReusePortResult>

Set SOL_SOCKET -> SO_REUSEPORT.

source

pub fn get_reuse_port(&self) -> QueryResponseFut<BaseSocketGetReusePortResult>

Get SOL_SOCKET -> SO_REUSEPORT.

source

pub fn get_accept_conn(&self) -> QueryResponseFut<BaseSocketGetAcceptConnResult>

Get SOL_SOCKET -> SO_ACCEPTCONN.

source

pub fn set_bind_to_device( &self, value: &str ) -> QueryResponseFut<BaseSocketSetBindToDeviceResult>

Set SOL_SOCKET -> SO_BINDTODEVICE.

source

pub fn get_bind_to_device( &self ) -> QueryResponseFut<BaseSocketGetBindToDeviceResult>

Get SOL_SOCKET -> SO_BINDTODEVICE.

source

pub fn set_bind_to_interface_index( &self, value: u64 ) -> QueryResponseFut<BaseSocketSetBindToInterfaceIndexResult>

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

source

pub fn get_bind_to_interface_index( &self ) -> QueryResponseFut<BaseSocketGetBindToInterfaceIndexResult>

Get SOL_SOCKET -> SO_BINDTOIFINDEX.

source

pub fn set_timestamp( &self, value: TimestampOption ) -> QueryResponseFut<BaseSocketSetTimestampResult>

Set SOL_SOCKET -> SO_TIMESTAMP or SO_TIMESTAMPNS.

source

pub fn get_timestamp(&self) -> QueryResponseFut<BaseSocketGetTimestampResult>

Get SOL_SOCKET -> SO_TIMESTAMP or SO_TIMESTAMPNS.

source

pub fn describe(&self) -> QueryResponseFut<SocketDescribeResponse>

source

pub fn bind( &self, protocol: Option<&ProtocolAssociation>, bound_interface_id: &BoundInterfaceId ) -> QueryResponseFut<SocketBindResult>

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.
source

pub fn get_info(&self) -> QueryResponseFut<SocketGetInfoResult>

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.
source

pub fn recv_msg( &self, want_packet_info: bool, data_len: u32, want_control: bool, flags: RecvMsgFlags ) -> QueryResponseFut<SocketRecvMsgResult>

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.
source

pub fn send_msg( &self, packet_info: Option<&PacketInfo>, data: &[u8], control: &SendControlData, flags: SendMsgFlags ) -> QueryResponseFut<SocketSendMsgResult>

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.

Trait Implementations§

source§

impl Clone for SocketProxy

source§

fn clone(&self) -> SocketProxy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SocketProxy

source§

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

Formats the value using the given formatter. Read more
source§

impl Proxy for SocketProxy

§

type Protocol = SocketMarker

The protocol which this Proxy controls.
source§

fn from_channel(inner: AsyncChannel) -> Self

Create a proxy over the given channel.
source§

fn into_channel(self) -> Result<AsyncChannel, Self>

Attempt to convert the proxy back into a channel. Read more
source§

fn as_channel(&self) -> &AsyncChannel

Get a reference to the proxy’s underlying channel. Read more
§

fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>

Attempt to convert the proxy back into a client end. Read more
§

fn is_closed(&self) -> bool

Returns true if the proxy has received the PEER_CLOSED signal.
§

fn on_closed(&self) -> OnSignals<'_, Unowned<'_, Handle>>

Returns a future that completes when the proxy receives the PEER_CLOSED signal.
source§

impl SocketProxyInterface for SocketProxy

source§

fn clone2(&self, request: ServerEnd<CloneableMarker>) -> Result<(), Error>

§

type CloseResponseFut = QueryResponseFut<Result<(), i32>>

source§

fn close(&self) -> Self::CloseResponseFut

§

type QueryResponseFut = QueryResponseFut<Vec<u8>>

source§

fn query(&self) -> Self::QueryResponseFut

§

type SetReuseAddressResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn set_reuse_address(&self, value: bool) -> Self::SetReuseAddressResponseFut

§

type GetReuseAddressResponseFut = QueryResponseFut<Result<bool, Errno>>

source§

fn get_reuse_address(&self) -> Self::GetReuseAddressResponseFut

§

type GetErrorResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn get_error(&self) -> Self::GetErrorResponseFut

§

type SetBroadcastResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn set_broadcast(&self, value: bool) -> Self::SetBroadcastResponseFut

§

type GetBroadcastResponseFut = QueryResponseFut<Result<bool, Errno>>

source§

fn get_broadcast(&self) -> Self::GetBroadcastResponseFut

§

type SetSendBufferResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn set_send_buffer(&self, value_bytes: u64) -> Self::SetSendBufferResponseFut

§

type GetSendBufferResponseFut = QueryResponseFut<Result<u64, Errno>>

source§

fn get_send_buffer(&self) -> Self::GetSendBufferResponseFut

§

type SetReceiveBufferResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn set_receive_buffer( &self, value_bytes: u64 ) -> Self::SetReceiveBufferResponseFut

§

type GetReceiveBufferResponseFut = QueryResponseFut<Result<u64, Errno>>

source§

fn get_receive_buffer(&self) -> Self::GetReceiveBufferResponseFut

§

type SetKeepAliveResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn set_keep_alive(&self, value: bool) -> Self::SetKeepAliveResponseFut

§

type GetKeepAliveResponseFut = QueryResponseFut<Result<bool, Errno>>

source§

fn get_keep_alive(&self) -> Self::GetKeepAliveResponseFut

§

type SetOutOfBandInlineResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn set_out_of_band_inline( &self, value: bool ) -> Self::SetOutOfBandInlineResponseFut

§

type GetOutOfBandInlineResponseFut = QueryResponseFut<Result<bool, Errno>>

source§

fn get_out_of_band_inline(&self) -> Self::GetOutOfBandInlineResponseFut

§

type SetNoCheckResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn set_no_check(&self, value: bool) -> Self::SetNoCheckResponseFut

§

type GetNoCheckResponseFut = QueryResponseFut<Result<bool, Errno>>

source§

fn get_no_check(&self) -> Self::GetNoCheckResponseFut

§

type SetLingerResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn set_linger( &self, linger: bool, length_secs: u32 ) -> Self::SetLingerResponseFut

§

type GetLingerResponseFut = QueryResponseFut<Result<(bool, u32), Errno>>

source§

fn get_linger(&self) -> Self::GetLingerResponseFut

§

type SetReusePortResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn set_reuse_port(&self, value: bool) -> Self::SetReusePortResponseFut

§

type GetReusePortResponseFut = QueryResponseFut<Result<bool, Errno>>

source§

fn get_reuse_port(&self) -> Self::GetReusePortResponseFut

§

type GetAcceptConnResponseFut = QueryResponseFut<Result<bool, Errno>>

source§

fn get_accept_conn(&self) -> Self::GetAcceptConnResponseFut

§

type SetBindToDeviceResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn set_bind_to_device(&self, value: &str) -> Self::SetBindToDeviceResponseFut

§

type GetBindToDeviceResponseFut = QueryResponseFut<Result<String, Errno>>

source§

fn get_bind_to_device(&self) -> Self::GetBindToDeviceResponseFut

§

type SetBindToInterfaceIndexResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn set_bind_to_interface_index( &self, value: u64 ) -> Self::SetBindToInterfaceIndexResponseFut

§

type GetBindToInterfaceIndexResponseFut = QueryResponseFut<Result<u64, Errno>>

source§

fn get_bind_to_interface_index( &self ) -> Self::GetBindToInterfaceIndexResponseFut

§

type SetTimestampResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn set_timestamp(&self, value: TimestampOption) -> Self::SetTimestampResponseFut

§

type GetTimestampResponseFut = QueryResponseFut<Result<TimestampOption, Errno>>

source§

fn get_timestamp(&self) -> Self::GetTimestampResponseFut

§

type DescribeResponseFut = QueryResponseFut<SocketDescribeResponse>

source§

fn describe(&self) -> Self::DescribeResponseFut

§

type BindResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn bind( &self, protocol: Option<&ProtocolAssociation>, bound_interface_id: &BoundInterfaceId ) -> Self::BindResponseFut

§

type GetInfoResponseFut = QueryResponseFut<Result<(Kind, Option<Box<ProtocolAssociation>>, BoundInterface), Errno>>

source§

fn get_info(&self) -> Self::GetInfoResponseFut

§

type RecvMsgResponseFut = QueryResponseFut<Result<(Option<Box<RecvPacketInfo>>, Vec<u8>, RecvControlData, u32), Errno>>

source§

fn recv_msg( &self, want_packet_info: bool, data_len: u32, want_control: bool, flags: RecvMsgFlags ) -> Self::RecvMsgResponseFut

§

type SendMsgResponseFut = QueryResponseFut<Result<(), Errno>>

source§

fn send_msg( &self, packet_info: Option<&PacketInfo>, data: &[u8], control: &SendControlData, flags: SendMsgFlags ) -> Self::SendMsgResponseFut

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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