pub struct Emit<T: Send + 'static> { /* private fields */ }Expand description
One open stream, handed to an arm. A Rust arm calls Emit::emit and then Emit::end or
Emit::fail; a foreign arm receives Emit::token and delivers through the generated
<fn>_emit / <fn>_end / <fn>_fail helpers.
Implementations§
Source§impl<T: Send + 'static> Emit<T>
impl<T: Send + 'static> Emit<T>
Sourcepub fn new(
streams: &'static Streams<T>,
cb: impl FnMut(Item<T>) + Send + 'static,
) -> Self
pub fn new( streams: &'static Streams<T>, cb: impl FnMut(Item<T>) + Send + 'static, ) -> Self
Register cb and produce the handle the arm receives.
Sourcepub fn token(&self) -> u64
pub fn token(&self) -> u64
The number a foreign arm carries and hands back to the generated helpers.
Sourcepub fn into_token(self) -> u64
pub fn into_token(self) -> u64
Hand the token to a foreign arm; the consumer stays registered until the stream ends, fails, or is stopped.
Trait Implementations§
Auto Trait Implementations§
impl<T> Forget for Emit<T>
impl<T> Freeze for Emit<T>
impl<T> Move for Emit<T>
impl<T> RefUnwindSafe for Emit<T>where
&'static Streams<T>: RefUnwindSafe,
impl<T> Send for Emit<T>
impl<T> Sync for Emit<T>
impl<T> Unpin for Emit<T>
impl<T> UnsafeUnpin for Emit<T>where
&'static Streams<T>: UnsafeUnpin,
impl<T> UnwindSafe for Emit<T>where
&'static Streams<T>: UnwindSafe,
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