pub struct EntityStream<T: Clone + Send + Sync + 'static> { /* private fields */ }Expand description
A subscription to a collection of entities.
Provides both point-in-time snapshot access and reactive change
notification via the changed() method or by converting to a Stream.
Implementations§
Source§impl<T: Clone + Send + Sync + 'static> EntityStream<T>
impl<T: Clone + Send + Sync + 'static> EntityStream<T>
Sourcepub fn latest(&self) -> Arc<Vec<Arc<T>>>
pub fn latest(&self) -> Arc<Vec<Arc<T>>>
Get the latest snapshot (may have changed since creation).
Sourcepub async fn changed(&mut self) -> Option<Arc<Vec<Arc<T>>>>
pub async fn changed(&mut self) -> Option<Arc<Vec<Arc<T>>>>
Wait for the next change, returning the new snapshot.
Returns None if the sender (DataStore) has been dropped.
Sourcepub fn into_stream(self) -> EntityWatchStream<T>
pub fn into_stream(self) -> EntityWatchStream<T>
Convert into a Stream for use with StreamExt combinators.
Auto Trait Implementations§
impl<T> Freeze for EntityStream<T>
impl<T> RefUnwindSafe for EntityStream<T>where
T: RefUnwindSafe,
impl<T> Send for EntityStream<T>
impl<T> Sync for EntityStream<T>
impl<T> Unpin for EntityStream<T>
impl<T> UnsafeUnpin for EntityStream<T>
impl<T> UnwindSafe for EntityStream<T>where
T: RefUnwindSafe,
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