pub struct Channel(/* private fields */);
Expand description
A channel in a remote FDomain.
Implementations§
Source§impl Channel
impl Channel
Sourcepub fn recv_msg(
&self,
) -> impl Future<Output = Result<MessageBuf, Error>> + use<>
pub fn recv_msg( &self, ) -> impl Future<Output = Result<MessageBuf, Error>> + use<>
Reads a message from the channel.
Sourcepub fn recv_from(
&self,
cx: &mut Context<'_>,
buf: &mut MessageBuf,
) -> Poll<Result<(), Error>>
pub fn recv_from( &self, cx: &mut Context<'_>, buf: &mut MessageBuf, ) -> Poll<Result<(), Error>>
Poll a channel for a message to read.
Sourcepub fn write(&self, bytes: &[u8], handles: Vec<Handle>) -> Result<(), Error>
pub fn write(&self, bytes: &[u8], handles: Vec<Handle>) -> Result<(), Error>
Writes a message into the channel.
Sourcepub fn fdomain_write(
&self,
bytes: &[u8],
handles: Vec<Handle>,
) -> impl Future<Output = Result<(), Error>> + use<>
pub fn fdomain_write( &self, bytes: &[u8], handles: Vec<Handle>, ) -> impl Future<Output = Result<(), Error>> + use<>
Writes a message into the channel. Returns a future that will allow you to wait for the write to move across the FDomain connection and return with the result of the actual write call on the target.
Sourcepub fn on_closed(&self) -> OnFDomainSignals ⓘ
pub fn on_closed(&self) -> OnFDomainSignals ⓘ
A future that returns when the channel is closed.
Sourcepub fn fdomain_write_etc<'b>(
&self,
bytes: &[u8],
handles: Vec<HandleOp<'b>>,
) -> impl Future<Output = Result<(), Error>> + use<'b>
pub fn fdomain_write_etc<'b>( &self, bytes: &[u8], handles: Vec<HandleOp<'b>>, ) -> impl Future<Output = Result<(), Error>> + use<'b>
Writes a message into the channel. Optionally duplicates some of the handles rather than consuming them, and can update the handle’s rights before sending.
Sourcepub fn stream(self) -> Result<(ChannelMessageStream, ChannelWriter), Error>
pub fn stream(self) -> Result<(ChannelMessageStream, ChannelWriter), Error>
Split this channel into a streaming reader and a writer. This is more efficient on the read side if you intend to consume all of the messages from the channel. However it will prevent you from transferring the handle in the future. It also means messages will build up in the buffer, so it may lead to memory issues if you don’t intend to use the messages from the channel as fast as they come.
Trait Implementations§
Source§impl AsHandleRef for Channel
impl AsHandleRef for Channel
Source§impl ChannelLike for Channel
impl ChannelLike for Channel
Source§fn write_epitaph(&self, bytes: &[u8]) -> Result<(), TransportError>
fn write_epitaph(&self, bytes: &[u8]) -> Result<(), TransportError>
Source§impl Encodable for Channel
impl Encodable for Channel
Source§type Encoded = WireHandle
type Encoded = WireHandle
Source§const COPY_OPTIMIZATION: CopyOptimization<Self, Self::Encoded> = _
const COPY_OPTIMIZATION: CopyOptimization<Self, Self::Encoded> = _
Self
to Self::Encoded
is equivalent to copying the raw bytes
of Self
. Read moreSource§impl EncodableAsHandle for Channel
impl EncodableAsHandle for Channel
Source§type Dialect = FDomainResourceDialect
type Dialect = FDomainResourceDialect
Source§impl EncodableOption for Channel
impl EncodableOption for Channel
Source§type EncodedOption = WireOptionalHandle
type EncodedOption = WireOptionalHandle
Source§impl<E: HandleEncoder + ?Sized> Encode<E> for Channel
impl<E: HandleEncoder + ?Sized> Encode<E> for Channel
Source§fn encode(
self,
encoder: &mut E,
out: &mut MaybeUninit<Self::Encoded>,
) -> Result<(), EncodeError>
fn encode( self, encoder: &mut E, out: &mut MaybeUninit<Self::Encoded>, ) -> Result<(), EncodeError>
Source§impl<E: HandleEncoder + ?Sized> EncodeOption<E> for Channel
impl<E: HandleEncoder + ?Sized> EncodeOption<E> for Channel
Source§fn encode_option(
this: Option<Self>,
encoder: &mut E,
out: &mut MaybeUninit<Self::EncodedOption>,
) -> Result<(), EncodeError>
fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<Self::EncodedOption>, ) -> Result<(), EncodeError>
Source§impl FromWire<WireHandle> for Channel
impl FromWire<WireHandle> for Channel
Source§fn from_wire(wire: WireHandle) -> Self
fn from_wire(wire: WireHandle) -> Self
wire
to this type.Source§const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
Source§impl FromWireOption<WireOptionalHandle> for Channel
impl FromWireOption<WireOptionalHandle> for Channel
Source§fn from_wire_option(wire: WireOptionalHandle) -> Option<Self>
fn from_wire_option(wire: WireOptionalHandle) -> Option<Self>
wire
to an option of this type.Source§impl HandleBased for Channel
impl HandleBased for Channel
Source§fn close(self) -> impl Future<Output = Result<(), Error>>
fn close(self) -> impl Future<Output = Result<(), Error>>
Source§fn duplicate_handle(
&self,
rights: Rights,
) -> impl Future<Output = Result<Self, Error>>
fn duplicate_handle( &self, rights: Rights, ) -> impl Future<Output = Result<Self, Error>>
Source§fn replace_handle(
self,
rights: Rights,
) -> impl Future<Output = Result<Self, Error>>
fn replace_handle( self, rights: Rights, ) -> impl Future<Output = Result<Self, Error>>
Source§fn into_handle(self) -> Handle
fn into_handle(self) -> Handle
Handle
.Source§fn from_handle(handle: Handle) -> Self
fn from_handle(handle: Handle) -> Self
Handle
.Source§fn into_handle_based<H: HandleBased>(self) -> H
fn into_handle_based<H: HandleBased>(self) -> H
Source§fn from_handle_based<H: HandleBased>(h: H) -> Self
fn from_handle_based<H: HandleBased>(h: H) -> Self
Source§impl Ord for Channel
impl Ord for Channel
Source§impl PartialOrd for Channel
impl PartialOrd for Channel
Source§impl ProxyChannelFor<FDomainResourceDialect> for Channel
impl ProxyChannelFor<FDomainResourceDialect> for Channel
Source§type Boxed = FDomainProxyChannel
type Boxed = FDomainProxyChannel
ProxyChannel
when using it within a client.Source§type HandleDisposition = HandleInfo
type HandleDisposition = HandleInfo
Source§impl Transport for Channel
impl Transport for Channel
Source§type SendBuffer = SendBuffer
type SendBuffer = SendBuffer
Source§type SendFutureState = SendFutureState
type SendFutureState = SendFutureState
Source§type Exclusive = Exclusive
type Exclusive = Exclusive
Source§type RecvFutureState = ()
type RecvFutureState = ()
Source§type RecvBuffer = RecvBuffer
type RecvBuffer = RecvBuffer
Source§fn split(self) -> (Self::Shared, Self::Exclusive)
fn split(self) -> (Self::Shared, Self::Exclusive)
Source§fn acquire(_: &Self::Shared) -> Self::SendBuffer
fn acquire(_: &Self::Shared) -> Self::SendBuffer
Source§fn begin_send(
sender: &Self::Shared,
buffer: Self::SendBuffer,
) -> Self::SendFutureState
fn begin_send( sender: &Self::Shared, buffer: Self::SendBuffer, ) -> Self::SendFutureState
SendBuffer
over this transport. Read moreSource§fn poll_send(
future_state: Pin<&mut Self::SendFutureState>,
ctx: &mut Context<'_>,
_: &Self::Shared,
) -> Poll<Result<(), Option<Self::Error>>>
fn poll_send( future_state: Pin<&mut Self::SendFutureState>, ctx: &mut Context<'_>, _: &Self::Shared, ) -> Poll<Result<(), Option<Self::Error>>>
SendFutureState
for completion with the shared part of the
transport. Read moreSource§fn begin_recv(
_: &Self::Shared,
_: &mut Self::Exclusive,
) -> Self::RecvFutureState
fn begin_recv( _: &Self::Shared, _: &mut Self::Exclusive, ) -> Self::RecvFutureState
RecvBuffer
over this transport. Read moreimpl Eq for Channel
impl RunsTransport<Channel> for FuchsiaAsync
impl StructuralPartialEq for Channel
Auto Trait Implementations§
impl Freeze for Channel
impl RefUnwindSafe for Channel
impl Send for Channel
impl Sync for Channel
impl Unpin for Channel
impl UnwindSafe for Channel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ChannelEpitaphExt for Twhere
T: ChannelLike,
impl<T> ChannelEpitaphExt for Twhere
T: ChannelLike,
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T, W> FromWireOption<WireBox<'_, W>> for Twhere
T: FromWire<W>,
impl<T, W> FromWireOption<WireBox<'_, W>> for Twhere
T: FromWire<W>,
Source§fn from_wire_option(wire: WireBox<'_, W>) -> Option<T>
fn from_wire_option(wire: WireBox<'_, W>) -> Option<T>
wire
to an option of this type.