Skip to main content

RecoverEvent

Trait RecoverEvent 

Source
pub trait RecoverEvent<Input, Path>: Sized {
    // Required method
    fn recover(event: Self) -> Result<Input, Self>;
}
Expand description

Exact recovery of one statically selected input from a returned event.

A failed runtime admission returns the complete root event. This ownership port recovers the original input without cloning, downcasting, or searching another lane. An event from a different lane is returned unchanged. Discarding the returned event cannot preserve an affine input:

ⓘ
type Event = behavior::EventLayer<
    String,
    behavior::User<behavior::MailAddr, ()>,
>;
let input = String::from("worker");
let event = <Event as behavior::InjectEvent<String, behavior::Here>>::inject_at(input);
drop(event);
drop(input);

Required Methods§

Source

fn recover(event: Self) -> Result<Input, Self>

Recover Input when this event belongs to Path.

§Errors

Returns the unchanged event when another lane owns it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Owned, Inner> RecoverEvent<Owned, Here> for EventLayer<Owned, Inner>

Source§

impl<Owned, Inner, Input, Path> RecoverEvent<Input, Inside<Path>> for EventLayer<Owned, Inner>
where Inner: RecoverEvent<Input, Path>,