Skip to main content

Machine

Struct Machine 

Source
pub struct Machine<'d, D: Session<'d>> { /* private fields */ }
Expand description

Exact session owner with one mutually exclusive input/output slot.

Implementations§

Source§

impl<'d, D: Session<'d>> Machine<'d, D>

Source

pub fn new(inner: D) -> Self

Source

pub fn input(&mut self) -> Access<Input<'_, 'd, D>>

Validates the one callback slot and binds vacancy to this borrow.

Source

pub const fn access(&self) -> Access<()>

Source

pub const fn progress(&self) -> Progress

Source

pub const fn output(&self) -> &Output

Source

pub const fn hold(&self) -> Hold

Source

pub fn finish<I>( &mut self, owner: I, ) -> Result<(Finish<'_, 'd, D>, I), (FinishError, I)>

Binds an orderly-input finish while preserving the caller’s exact owner on both transition outcomes.

Source

pub fn transact<R, E>( &mut self, output: &mut [u8], scratch: &mut Vec<u8>, admit: impl for<'turn> FnOnce(usize, Emission<'turn, 'd, D>) -> Admission<'turn, 'd, D, R, E>, ) -> Transaction<R, E>

Joins at most one session callback to one native admission attempt.

Source

pub fn retire(&mut self)

Retires the session once at the adapter’s observable close boundary.

Auto Trait Implementations§

§

impl<'d, D> !RefUnwindSafe for Machine<'d, D>

§

impl<'d, D> !Send for Machine<'d, D>

§

impl<'d, D> !Sync for Machine<'d, D>

§

impl<'d, D> !UnwindSafe for Machine<'d, D>

§

impl<'d, D> Forget for Machine<'d, D>

§

impl<'d, D> Freeze for Machine<'d, D>
where D: Freeze,

§

impl<'d, D> Unpin for Machine<'d, D>
where D: Unpin,

§

impl<'d, D> UnsafeUnpin for Machine<'d, D>
where D: UnsafeUnpin,

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

Source§

fn into(self) -> T

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.