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>>
pub fn recv_msg(&self) -> impl Future<Output = Result<MessageBuf, Error>>
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>> + '_
pub fn fdomain_write( &self, bytes: &[u8], handles: Vec<Handle>, ) -> impl Future<Output = Result<(), Error>> + '_
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>> + 'b
pub fn fdomain_write_etc<'b>( &self, bytes: &[u8], handles: Vec<HandleOp<'b>>, ) -> impl Future<Output = Result<(), Error>> + '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 EncodableAsHandle for Channel
impl EncodableAsHandle for Channel
Source§type Dialect = FDomainResourceDialect
type Dialect = FDomainResourceDialect
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.