Skip to main content

UpdateOutcome

Struct UpdateOutcome 

Source
pub struct UpdateOutcome<T, E, R = (), DO = DropUndecided, const EVENTS_DECIDED: bool = false> { /* private fields */ }
Expand description

What an update performed under the lock produced: the events to queue, a value to drop once they were delivered, and the result to give back to the caller.

The two type-state parameters make each effect settable at most once, and let the arms of a branching update share one type: an arm that sets no events next to one that does still has to say so, with Self::without_events.

Implementations§

Source§

impl<T, E, R> UpdateOutcome<T, E, R>

Source

pub fn new(result: R) -> Self

Source§

impl<T, E> UpdateOutcome<T, E>

Source

pub fn empty() -> Self

Source§

impl<T, E, R, const EVENTS_DECIDED: bool> UpdateOutcome<T, E, R, DropUndecided, EVENTS_DECIDED>

Source

pub fn with_drop_outside<DO>( self, drop_outside: DO, ) -> UpdateOutcome<T, E, R, DropDecided<DO>, EVENTS_DECIDED>

Source

pub fn without_drop_outside<DO>( self, ) -> UpdateOutcome<T, E, R, DropDecided<DO>, EVENTS_DECIDED>

Source§

impl<T, E, R, DO> UpdateOutcome<T, E, R, DO, false>

Source

pub fn with_next_event(self, next: T) -> UpdateOutcome<T, E, R, DO, true>

Source

pub fn with_termination_event( self, termination: Termination<E>, ) -> UpdateOutcome<T, E, R, DO, true>

Source

pub fn with_next_and_termination_events( self, next: T, termination: Termination<E>, ) -> UpdateOutcome<T, E, R, DO, true>

Source

pub fn with_events( self, events: EventBatch<T, E>, ) -> UpdateOutcome<T, E, R, DO, true>

Source

pub fn without_events(self) -> UpdateOutcome<T, E, R, DO, true>

Trait Implementations§

Source§

impl<T, E, R, DO, const EVENTS_DECIDED: bool> Debug for UpdateOutcome<T, E, R, DO, EVENTS_DECIDED>
where Option<EventBatch<T, E>>: Debug, DO: Debug, R: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T, E, R, DO, const EVENTS_DECIDED: bool> Freeze for UpdateOutcome<T, E, R, DO, EVENTS_DECIDED>
where Option<EventBatch<T, E>>: Freeze, DO: Freeze, R: Freeze,

§

impl<T, E, R, DO, const EVENTS_DECIDED: bool> RefUnwindSafe for UpdateOutcome<T, E, R, DO, EVENTS_DECIDED>

§

impl<T, E, R, DO, const EVENTS_DECIDED: bool> Send for UpdateOutcome<T, E, R, DO, EVENTS_DECIDED>
where Option<EventBatch<T, E>>: Send, DO: Send, R: Send,

§

impl<T, E, R, DO, const EVENTS_DECIDED: bool> Sync for UpdateOutcome<T, E, R, DO, EVENTS_DECIDED>
where Option<EventBatch<T, E>>: Sync, DO: Sync, R: Sync,

§

impl<T, E, R, DO, const EVENTS_DECIDED: bool> Unpin for UpdateOutcome<T, E, R, DO, EVENTS_DECIDED>
where Option<EventBatch<T, E>>: Unpin, DO: Unpin, R: Unpin,

§

impl<T, E, R, DO, const EVENTS_DECIDED: bool> UnsafeUnpin for UpdateOutcome<T, E, R, DO, EVENTS_DECIDED>

§

impl<T, E, R, DO, const EVENTS_DECIDED: bool> UnwindSafe for UpdateOutcome<T, E, R, DO, EVENTS_DECIDED>

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> MaybeSend for T
where T: Send,

Source§

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

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.