Skip to main content

DriverCaller

Struct DriverCaller 

Source
pub struct DriverCaller { /* private fields */ }
Expand description

Implements Caller: allocates a request ID, registers a response slot, sends one request attempt through the connection, and awaits the corresponding response.

Implementations§

Source§

impl DriverCaller

Source

pub fn create_tx_channel( &self, ) -> (ChannelId, Arc<CreditSink<DriverChannelSink>>)

Allocate a channel ID and create a credit-controlled sink for outbound items.

The returned sink enforces credit; the semaphore is registered so GrantCredit messages can add permits.

Source

pub fn register_rx_channel(&self, channel_id: ChannelId) -> BoundChannelReceiver

Register an inbound channel (Rx on our side) and return the receiver.

The channel ID comes from the peer (e.g. from RequestCall.channels). The returned receiver should be bound to an Rx handle via Rx::bind().

Trait Implementations§

Source§

impl Caller for DriverCaller

Source§

async fn call<'a>(&'a self, call: RequestCall<'a>) -> CallResult

Start one outgoing request attempt for an API-level call and wait for its response. Read more
Source§

fn closed(&self) -> BoxFut<'_, ()>

Resolve when the underlying connection closes. Read more
Source§

fn is_connected(&self) -> bool

Return whether the underlying connection is still considered connected. Read more
Source§

fn channel_binder(&self) -> Option<&dyn ChannelBinder>

Return a channel binder for binding Tx/Rx handles in args before sending. Read more
Source§

impl ChannelBinder for DriverCaller

Source§

fn create_tx(&self) -> (ChannelId, Arc<dyn ChannelSink>)

Allocate a channel ID and create a sink for sending items.
Source§

fn create_rx(&self) -> (ChannelId, BoundChannelReceiver)

Allocate a channel ID, register it for routing, and return a receiver.
Source§

fn bind_tx(&self, channel_id: ChannelId) -> Arc<dyn ChannelSink>

Create a sink for a known channel ID (callee side). Read more
Source§

fn register_rx(&self, channel_id: ChannelId) -> BoundChannelReceiver

Register an inbound channel by ID and return the receiver (callee side). Read more
Source§

fn channel_liveness(&self) -> Option<ChannelLivenessHandle>

Optional opaque handle that keeps the underlying session/connection alive for the lifetime of any bound channel handle.
Source§

impl Clone for DriverCaller

Source§

fn clone(&self) -> DriverCaller

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl From<DriverCaller> for NoopCaller

Source§

fn from(caller: DriverCaller) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ChannelLiveness for T
where T: MaybeSend + MaybeSync + 'static,

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSync for T
where T: Sync,