pub struct Chain<'c, S: Socket> { /* private fields */ }Expand description
A chain of method calls that will be sent together.
Use Connection::chain_call to create a new chain, extend it with Chain::append and send
the entire chain using Chain::send or Chain::send_ignore_replies.
With std feature enabled, this supports unlimited calls. Otherwise it is limited by how many
calls can fit in our fixed-sized buffer.
Oneway calls (where Call::oneway() == Some(true)) do not expect replies and are handled
automatically by the chain.
Implementations§
Source§impl<'c, S> Chain<'c, S>where
S: Socket,
impl<'c, S> Chain<'c, S>where
S: Socket,
Sourcepub fn append<Method>(
self,
call: &Call<Method>,
fds: Vec<OwnedFd>,
) -> Result<Self>
pub fn append<Method>( self, call: &Call<Method>, fds: Vec<OwnedFd>, ) -> Result<Self>
Append another method call to the chain.
The call will be enqueued but not sent until Chain::send is called. Note that one way
calls (where Call::oneway() == Some(true)) do not receive replies.
Calls with more == Some(true) will stream multiple replies until a reply with
continues != Some(true) is received.
In std mode, the fds parameter contains file descriptors to send along with the call.
Sourcepub async fn send<ReplyParams, ReplyError>(
self,
) -> Result<ReplyStream<'c, ReplyParams, ReplyError>>
pub async fn send<ReplyParams, ReplyError>( self, ) -> Result<ReplyStream<'c, ReplyParams, ReplyError>>
Send all enqueued calls and return a replies stream.
This will flush all enqueued calls in a single write operation and then return a stream that allows reading the replies.
In std mode, each reply includes any file descriptors received.
Sourcepub async fn send_ignore_replies(self) -> Result<()>
pub async fn send_ignore_replies(self) -> Result<()>
Send all enqueued calls and ignore the replies.
This will flush all enqueued calls in a single write operation and then read and discard all replies. Use this when you don’t need to process the responses.
Note: Any file descriptors received with replies will also be discarded.