pub struct Streams<T: 'static> { /* private fields */ }Expand description
The consumers of one Emit<T> declaration’s streams, keyed by token: the stream
counterpart of Registry. The generator emits one static per declaration.
Delivery rules that make a token safe to hand to a platform thread:
- In order, one at a time. Items pushed from several threads (a response callback and a writer thread, say) reach the consumer serially, in push order. The first pusher drains the queue; the others only enqueue.
- Re-entrancy is allowed. The consumer may stop its own stream, or cause another push to it, from inside the callback: neither waits on the callback’s lock.
- Terminal once. After
EndorFailedis pushed, further pushes returnfalse; afterStreams::stop, queued items are dropped.
Implementations§
Source§impl<T: Send + 'static> Streams<T>
impl<T: Send + 'static> Streams<T>
Sourcepub fn deliver(
&self,
token: u64,
status: i32,
outcome: Result<T, Error>,
) -> bool
pub fn deliver( &self, token: u64, status: i32, outcome: Result<T, Error>, ) -> bool
Deliver what a generated export received: status 0 is a value (or a failure, when the value did not convert), 2 the end, anything else a failure.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Streams<T>
impl<T> Forget for Streams<T>
impl<T> Move for Streams<T>
impl<T> RefUnwindSafe for Streams<T>
impl<T> Send for Streams<T>
impl<T> Sync for Streams<T>
impl<T> Unpin for Streams<T>
impl<T> UnsafeUnpin for Streams<T>
impl<T> UnwindSafe for Streams<T>
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