Skip to main content

Results

Struct Results 

Source
pub struct Results<E: Serialize> { /* private fields */ }
Expand description

The handler’s channel for the values a command produces while it runs.

Not Clone: Handler::handle receives it as a &mut borrow the framework owns, and a clone would let a handler keep emitting past its own run.

Implementations§

Source§

impl<E: Serialize> Results<E>

Source

pub fn discarding() -> Self

Source

pub fn recording(recorder: RunRecorder) -> Self

Source

pub fn for_run(recorder: Option<RunRecorder>, sink: Rc<dyn EventSink>) -> Self

The channel a run installs: every value is written, and retained too when the entry point has a recorder that keeps events.

Source

pub fn emit(&mut self, event: E) -> Result<(), EmitError>

Returns once the value has been written and retained; fails when it does not serialize, does not render, or cannot be written. The write comes first, so a value the destination refused is never retained. Every failure reaches the sink, the serialization one through EventSink::record_failure because it happens before the write.

Trait Implementations§

Source§

impl<E: Serialize> Debug for Results<E>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<E> !RefUnwindSafe for Results<E>

§

impl<E> !Send for Results<E>

§

impl<E> !Sync for Results<E>

§

impl<E> !UnwindSafe for Results<E>

§

impl<E> Freeze for Results<E>
where PhantomData<fn(E)>: Freeze,

§

impl<E> Unpin for Results<E>
where PhantomData<fn(E)>: Unpin,

§

impl<E> UnsafeUnpin for Results<E>

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.