pub struct Caller { /* private fields */ }Expand description
Concrete caller type wrapping a DriverCaller with optional middleware.
This is the primary type for making outbound RPC calls. Generated *Client
types store a Caller as a public field. Use with_middleware() to add
client middleware to the call chain.
Implementations§
Source§impl Caller
impl Caller
Sourcepub fn new(driver: DriverCaller) -> Self
pub fn new(driver: DriverCaller) -> Self
Create a new Caller wrapping a DriverCaller.
Sourcepub fn with_middleware(
self,
service: &'static ServiceDescriptor,
middleware: impl ClientMiddleware,
) -> Self
pub fn with_middleware( self, service: &'static ServiceDescriptor, middleware: impl ClientMiddleware, ) -> Self
Append a client middleware to this caller’s chain.
Sourcepub async fn call(&self, call: RequestCall<'_>) -> CallResult
pub async fn call(&self, call: RequestCall<'_>) -> CallResult
Start one outgoing request attempt and wait for its response, running any registered middleware around the call.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Return whether the underlying connection is still considered connected.
Sourcepub fn channel_binder(&self) -> Option<&dyn ChannelBinder>
pub fn channel_binder(&self) -> Option<&dyn ChannelBinder>
Return a channel binder for binding Tx/Rx handles in args before sending.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Caller
impl !RefUnwindSafe for Caller
impl Send for Caller
impl Sync for Caller
impl Unpin for Caller
impl UnsafeUnpin for Caller
impl !UnwindSafe for Caller
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