pub struct ChannelProxy { /* private fields */ }Implementations§
Source§impl ChannelProxy
impl ChannelProxy
Sourcepub fn take_event_stream(&self) -> ChannelEventStream
pub fn take_event_stream(&self) -> ChannelEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn create_channel(
&self,
handles: &[NewHandleId; 2],
) -> QueryResponseFut<ChannelCreateChannelResult, DefaultFuchsiaResourceDialect>
pub fn create_channel( &self, handles: &[NewHandleId; 2], ) -> QueryResponseFut<ChannelCreateChannelResult, DefaultFuchsiaResourceDialect>
Create a new channel in this FDomain and return both its ends.
Sourcepub fn read_channel(
&self,
handle: &HandleId,
) -> QueryResponseFut<ChannelReadChannelResult, DefaultFuchsiaResourceDialect>
pub fn read_channel( &self, handle: &HandleId, ) -> QueryResponseFut<ChannelReadChannelResult, DefaultFuchsiaResourceDialect>
Read a message from a channel. This method will fail if the channel is currently being read using the streaming read functions.
Note that this method is not like zx_channel_read in that it will not
return SHOULD_WAIT but will instead delay returning until there is data
to return.
Sourcepub fn write_channel(
&self,
handle: &HandleId,
data: &[u8],
handles: &Handles,
) -> QueryResponseFut<ChannelWriteChannelResult, DefaultFuchsiaResourceDialect>
pub fn write_channel( &self, handle: &HandleId, data: &[u8], handles: &Handles, ) -> QueryResponseFut<ChannelWriteChannelResult, DefaultFuchsiaResourceDialect>
Write to a channel. Handles are always consumed.
Sourcepub fn read_channel_streaming_start(
&self,
handle: &HandleId,
) -> QueryResponseFut<ChannelReadChannelStreamingStartResult, DefaultFuchsiaResourceDialect>
pub fn read_channel_streaming_start( &self, handle: &HandleId, ) -> QueryResponseFut<ChannelReadChannelStreamingStartResult, DefaultFuchsiaResourceDialect>
Starts reading from the given channel. Data is returned via the ChannelStreamingData event.
That event will occur repeatedly until ReadChannelStreamingStop is called for the same handle
or the event indicates the handle is closed.
Sourcepub fn read_channel_streaming_stop(
&self,
handle: &HandleId,
) -> QueryResponseFut<ChannelReadChannelStreamingStopResult, DefaultFuchsiaResourceDialect>
pub fn read_channel_streaming_stop( &self, handle: &HandleId, ) -> QueryResponseFut<ChannelReadChannelStreamingStopResult, DefaultFuchsiaResourceDialect>
Stop asynchronous reading from the given channel.
Trait Implementations§
Source§impl ChannelProxyInterface for ChannelProxy
impl ChannelProxyInterface for ChannelProxy
type CreateChannelResponseFut = QueryResponseFut<Result<(), Error>>
type ReadChannelResponseFut = QueryResponseFut<Result<(Vec<u8>, Vec<HandleInfo>), Error>>
type WriteChannelResponseFut = QueryResponseFut<Result<(), WriteChannelError>>
type ReadChannelStreamingStartResponseFut = QueryResponseFut<Result<(), Error>>
type ReadChannelStreamingStopResponseFut = QueryResponseFut<Result<(), Error>>
fn create_channel( &self, handles: &[NewHandleId; 2], ) -> Self::CreateChannelResponseFut
fn read_channel(&self, handle: &HandleId) -> Self::ReadChannelResponseFut
fn write_channel( &self, handle: &HandleId, data: &[u8], handles: &Handles, ) -> Self::WriteChannelResponseFut
fn read_channel_streaming_start( &self, handle: &HandleId, ) -> Self::ReadChannelStreamingStartResponseFut
fn read_channel_streaming_stop( &self, handle: &HandleId, ) -> Self::ReadChannelStreamingStopResponseFut
Source§impl Clone for ChannelProxy
impl Clone for ChannelProxy
Source§fn clone(&self) -> ChannelProxy
fn clone(&self) -> ChannelProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChannelProxy
impl Debug for ChannelProxy
Source§impl Proxy for ChannelProxy
impl Proxy for ChannelProxy
Source§type Protocol = ChannelMarker
type Protocol = ChannelMarker
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.