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>
impl<E: Serialize> Results<E>
pub fn discarding() -> Self
pub fn recording(recorder: RunRecorder) -> Self
Sourcepub fn for_run(recorder: Option<RunRecorder>, sink: Rc<dyn EventSink>) -> Self
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.
Sourcepub fn emit(&mut self, event: E) -> Result<(), EmitError>
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§
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>
impl<E> Unpin for Results<E>
impl<E> UnsafeUnpin for Results<E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more