pub struct Attach<P: Phase, Prod: Producer, Cons: Consumer> { /* private fields */ }Expand description
The typed attach handle. P is the current phase; the available
methods are gated on P so malformed call sequences are compile
errors rather than runtime mismatches.
Implementations§
Source§impl<Prod, Cons> Attach<Spawned, Prod, Cons>
impl<Prod, Cons> Attach<Spawned, Prod, Cons>
Sourcepub fn subscribe(
self,
) -> Result<(Attach<Subscribed, Prod, Cons>, History<Prod::Snap>), AttachError>
pub fn subscribe( self, ) -> Result<(Attach<Subscribed, Prod, Cons>, History<Prod::Snap>), AttachError>
Spawned → Subscribed. Subscribe to the live stream FIRST
(so no item between subscribe and snapshot is lost), then
capture the snapshot. Returns the new phase + a History
handle that must be passed to replay (drop-bomb prevents
forgetting).
Source§impl<Prod, Cons> Attach<Subscribed, Prod, Cons>
impl<Prod, Cons> Attach<Subscribed, Prod, Cons>
Source§impl<Prod, Cons> Attach<Synced, Prod, Cons>
impl<Prod, Cons> Attach<Synced, Prod, Cons>
Sourcepub fn start_live(self) -> Attach<Live, Prod, Cons>
pub fn start_live(self) -> Attach<Live, Prod, Cons>
Synced → Live. Items queued in the live receiver since
subscribe begin flowing into the consumer. Returns
Attach<Live> — the only phase from which run is reachable.
Source§impl<Prod, Cons> Attach<Live, Prod, Cons>
impl<Prod, Cons> Attach<Live, Prod, Cons>
Auto Trait Implementations§
impl<P, Prod, Cons> !Sync for Attach<P, Prod, Cons>
impl<P, Prod, Cons> Freeze for Attach<P, Prod, Cons>
impl<P, Prod, Cons> RefUnwindSafe for Attach<P, Prod, Cons>
impl<P, Prod, Cons> Send for Attach<P, Prod, Cons>
impl<P, Prod, Cons> Unpin for Attach<P, Prod, Cons>
impl<P, Prod, Cons> UnsafeUnpin for Attach<P, Prod, Cons>where
Prod: UnsafeUnpin,
Cons: UnsafeUnpin,
impl<P, Prod, Cons> UnwindSafe for Attach<P, Prod, Cons>
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