Skip to main content

CallerHandle

Struct CallerHandle 

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

The Caller port role.

One counter for the whole handle, not one per channel: on a call the scope is the caller instance (ADR-0021 decision 5, and driftsys/ridl#308’s own report), so every call this caller sends draws from one sequence. That is what keeps two callers on one provider from colliding.

The call table is the runtime’s, shared by every caller: with Loopback::SLOTS calls sent and not forgotten, a send answers SendError::Busy and draws no sequence number, because nothing was sent.

Trait Implementations§

Source§

impl Attached for CallerHandle

Source§

fn catalog(&self) -> &CatalogRef

The catalog this port serves.
Source§

impl Caller for CallerHandle

Source§

fn command( &mut self, iface: InterfaceNo, ord: Ordinal, args: &[u8], trace: Option<TraceContext>, ) -> Result<Correlation, SendError>

Sends a command and returns the correlation of its outcome.
Source§

fn query( &mut self, iface: InterfaceNo, ord: Ordinal, args: &[u8], trace: Option<TraceContext>, ) -> Result<Correlation, SendError>

Sends a query and returns the correlation of its reply.
Source§

fn ack(&mut self, c: Correlation) -> Option<Result<(), CallError>>

A command’s delivery acknowledgment (ridl §6.1), once it is known: Ok(()) when accepted, Err(CallError::Contract(_)) when rejected, Err(CallError::Transport(Transport::Corrupt)) when the provider could not read the command’s argument bytes, Err(CallError::Transport(Transport::Busy)) when the providing runtime refused the command at admission, and Err(CallError::Transport(Transport::Undelivered)) when no acknowledgment came within the bound. None while unknown, and always None for a query’s correlation. Read more
Source§

fn reply( &mut self, c: Correlation, out: &mut [u8], ) -> Result<Option<Result<usize, CallError>>, ReadError>

A query’s reply, once it is known: the reply bytes copied into the front of out and their length, or the error. Ok(None) while unknown. ReadError::Short does not consume the reply. Read more
Source§

fn forget(&mut self, c: Correlation)

Releases a correlation whose outcome the caller no longer needs.
Source§

impl Clock for CallerHandle

The caller reads the runtime’s one clock, so a generated async Client can compute a call’s deadline over this handle alone.

Source§

fn now(&self) -> Timestamp

The current time in the platform time base.
Source§

impl Drop for CallerHandle

A dropped caller’s Slot waker leaves the store, and every call it sent and did not forget is forgotten, so its slot comes back. The waker is dropped after the lock is released, as the source’s is.

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Wakeable for CallerHandle

Stores one Outcome waker per call, kept with the call and woken by its settlement, its forget, the drop of this handle, or a displacement by another task. Stores one Slot waker, woken at once while a slot is free and otherwise by the next reclaim.

Source§

fn wake_on(&self, what: Interest, waker: &Waker)

Wakes waker when the thing what names may have changed, under the contract above.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.