Skip to main content

HandlerHandle

Struct HandlerHandle 

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

The Handler port role.

A handler that has served nothing is presented every call waiting in the store; once it has served anything, it is presented only the members it served, and another handler’s calls stay waiting for that handler. A claim belongs to the handler it was presented to, so another handler’s settle of it answers SettleError::UnknownClaim.

The empty set meaning no filter is a deliberate deviation from Handler::serve, which says delivery starts at the members listed. The generated dispatch never calls serve (crates/ridl-backend-rust/src/face.rs), so a handler that always filtered would be presented nothing at all by it. serve with an empty slice records nothing and so leaves the handler unfiltered, the same as never having called it. served reads the set back.

Implementations§

Source§

impl HandlerHandle

Source

pub fn served(&self) -> &[(InterfaceNo, Ordinal)]

The members serve was called with, in the order they were served, with no duplicate.

Trait Implementations§

Source§

impl Attached for HandlerHandle

Source§

fn catalog(&self) -> &CatalogRef

The catalog this port serves.
Source§

impl Handler for HandlerHandle

Source§

fn serve( &mut self, iface: InterfaceNo, ords: &[Ordinal], ) -> Result<(), ServeError>

Starts presenting calls to the listed members.
Source§

fn next_claim(&mut self, out: &mut [u8]) -> Result<Option<Claim>, ReadError>

Copies the next call’s arguments into the front of out. Ok(None) when no call is waiting. ReadError::Short does not consume the call.
Source§

fn settle( &mut self, claim: ClaimId, outcome: Result<&[u8], CallError>, ) -> Result<(), SettleError>

Settles a claim with the reply bytes (empty for a command) or the outcome the caller sees. A provider settles CallError::Contract when the arguments break their typl constraints, a require clause fails, or an ensure clause fails, and CallError::Transport(Transport::Corrupt) when the argument bytes fail the structure check.

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.