Skip to main content

ParamReturnState

Struct ParamReturnState 

Source
pub struct ParamReturnState<T, R> { /* private fields */ }
Expand description

A call’s stored parameters and the value its body last returned, held in one slot: a call that skips its body finds both with one lookup.

Implementations§

Source§

impl<T, R> ParamReturnState<T, R>

Source

pub fn update_fields( &mut self, fresh: impl FnOnce() -> T, refresh: impl FnOnce(&mut T) -> bool, ) -> bool

ParamState::update_fields for the stored parameters.

Source

pub fn value(&self) -> Option<T>
where T: Clone,

Source

pub fn returned(&self) -> Option<R>
where R: Clone,

The value the call’s body returned last.

Source

pub fn store_return(&mut self, value: R)

Trait Implementations§

Source§

impl<T, R> Default for ParamReturnState<T, R>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T, R> Freeze for ParamReturnState<T, R>
where ParamState<T>: Freeze, Option<R>: Freeze,

§

impl<T, R> RefUnwindSafe for ParamReturnState<T, R>

§

impl<T, R> Send for ParamReturnState<T, R>
where ParamState<T>: Send, Option<R>: Send,

§

impl<T, R> Sync for ParamReturnState<T, R>
where ParamState<T>: Sync, Option<R>: Sync,

§

impl<T, R> Unpin for ParamReturnState<T, R>
where ParamState<T>: Unpin, Option<R>: Unpin,

§

impl<T, R> UnsafeUnpin for ParamReturnState<T, R>

§

impl<T, R> UnwindSafe for ParamReturnState<T, R>

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.