pub struct SocketProxy { /* private fields */ }Implementations§
Source§impl SocketProxy
impl SocketProxy
Sourcepub fn take_event_stream(&self) -> SocketEventStream
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.
Sourcepub fn create_socket(
&self,
options: SocketType,
handles: &[NewHandleId; 2],
) -> QueryResponseFut<SocketCreateSocketResult, DefaultFuchsiaResourceDialect>
pub fn create_socket( &self, options: SocketType, handles: &[NewHandleId; 2], ) -> QueryResponseFut<SocketCreateSocketResult, DefaultFuchsiaResourceDialect>
Create a new socket in this FDomain and return both its ends.
Sourcepub fn set_socket_disposition(
&self,
handle: &HandleId,
disposition: SocketDisposition,
disposition_peer: SocketDisposition,
) -> QueryResponseFut<SocketSetSocketDispositionResult, DefaultFuchsiaResourceDialect>
pub fn set_socket_disposition( &self, handle: &HandleId, disposition: SocketDisposition, disposition_peer: SocketDisposition, ) -> QueryResponseFut<SocketSetSocketDispositionResult, DefaultFuchsiaResourceDialect>
Set the disposition of a given socket.
Sourcepub fn read_socket(
&self,
handle: &HandleId,
max_bytes: u64,
) -> QueryResponseFut<SocketReadSocketResult, DefaultFuchsiaResourceDialect>
pub fn read_socket( &self, handle: &HandleId, max_bytes: u64, ) -> QueryResponseFut<SocketReadSocketResult, DefaultFuchsiaResourceDialect>
Read data from a socket. This method will fail if the socket is currently being read asynchronously.
Sourcepub fn write_socket(
&self,
handle: &HandleId,
data: &[u8],
) -> QueryResponseFut<SocketWriteSocketResult, DefaultFuchsiaResourceDialect>
pub fn write_socket( &self, handle: &HandleId, data: &[u8], ) -> QueryResponseFut<SocketWriteSocketResult, DefaultFuchsiaResourceDialect>
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.
Sourcepub fn read_socket_streaming_start(
&self,
handle: &HandleId,
) -> QueryResponseFut<SocketReadSocketStreamingStartResult, DefaultFuchsiaResourceDialect>
pub fn read_socket_streaming_start( &self, handle: &HandleId, ) -> QueryResponseFut<SocketReadSocketStreamingStartResult, DefaultFuchsiaResourceDialect>
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.
Sourcepub fn read_socket_streaming_stop(
&self,
handle: &HandleId,
) -> QueryResponseFut<SocketReadSocketStreamingStopResult, DefaultFuchsiaResourceDialect>
pub fn read_socket_streaming_stop( &self, handle: &HandleId, ) -> QueryResponseFut<SocketReadSocketStreamingStopResult, DefaultFuchsiaResourceDialect>
Stop asynchronous reading from the given socket.
Trait Implementations§
Source§impl Clone for SocketProxy
impl Clone for SocketProxy
Source§fn clone(&self) -> SocketProxy
fn clone(&self) -> SocketProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SocketProxy
impl Debug for SocketProxy
Source§impl Proxy for SocketProxy
impl Proxy for SocketProxy
Source§type Protocol = SocketMarker
type Protocol = SocketMarker
Proxy controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
Source§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Source§fn on_closed(&self) -> OnSignals<'_, Unowned<'_, NullableHandle>>
fn on_closed(&self) -> OnSignals<'_, Unowned<'_, NullableHandle>>
PEER_CLOSED signal.