pub struct CallBuilder<'a> { /* private fields */ }
Expand description
A builder for RPCs returned by Client::call
.
Implementations§
Source§impl CallBuilder<'_>
impl CallBuilder<'_>
Sourcepub fn timeout(&mut self, timeout: Option<Duration>) -> &mut Self
pub fn timeout(&mut self, timeout: Option<Duration>) -> &mut Self
Sets the timeout for the RPC.
Internally, this will immediately compute a deadline that is timeout
from now.
Sourcepub fn deadline(&mut self, deadline: Option<Deadline>) -> &mut Self
pub fn deadline(&mut self, deadline: Option<Deadline>) -> &mut Self
Sets the deadline for the RPC.
Sourcepub fn wait_ready(&mut self, wait_ready: bool) -> &mut Self
pub fn wait_ready(&mut self, wait_ready: bool) -> &mut Self
Sets whether the client should wait for the server to be ready before sending the RPC.
If this is not set and a connection to the server cannot be established, the RPC will fail. Otherwise, the RPC will keep waiting for a connection until its deadline.
Sourcepub fn start<F, R, T, U>(&self, rpc: F, input: T) -> Call<U> ⓘwhere
F: FnOnce(T, OneshotSender<Result<U, Status>>) -> R,
R: ServiceRpc,
U: 'static + MeshPayload + Send,
pub fn start<F, R, T, U>(&self, rpc: F, input: T) -> Call<U> ⓘwhere
F: FnOnce(T, OneshotSender<Result<U, Status>>) -> R,
R: ServiceRpc,
U: 'static + MeshPayload + Send,
Starts the RPC.
To get the RPC result, await
the returned future.
Auto Trait Implementations§
impl<'a> Freeze for CallBuilder<'a>
impl<'a> !RefUnwindSafe for CallBuilder<'a>
impl<'a> Send for CallBuilder<'a>
impl<'a> Sync for CallBuilder<'a>
impl<'a> Unpin for CallBuilder<'a>
impl<'a> !UnwindSafe for CallBuilder<'a>
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
Mutably borrows from an owned value. Read more