pub struct ResultSet<R: View>(/* private fields */);Expand description
View-typed ResultSet
Implementations§
Methods from Deref<Target = EntityResultSet<Entity>>§
Sourcepub fn write(&self) -> ResultSetWrite<'_, E>
pub fn write(&self) -> ResultSetWrite<'_, E>
Begin a write operation for atomic changes to the resultset All mutations happen through the returned write guard A single notification is sent when the guard is dropped (if changes were made)
Sourcepub fn read(&self) -> ResultSetRead<'_, E>
pub fn read(&self) -> ResultSetRead<'_, E>
Get a read guard for consistent read-only access to the resultset
pub fn set_loaded(&self, loaded: bool)
pub fn is_loaded(&self) -> bool
pub fn clear(&self)
Sourcepub fn keys(&self) -> EntityResultSetKeyIterator ⓘ
pub fn keys(&self) -> EntityResultSetKeyIterator ⓘ
Get an iterator over entity IDs without cloning entities
Sourcepub fn contains_key(&self, id: &EntityId) -> bool
pub fn contains_key(&self, id: &EntityId) -> bool
Check if an entity with the given ID exists
pub fn by_id(&self, id: &EntityId) -> Option<E>
pub fn len(&self) -> usize
pub fn wrap<R: View>(&self) -> ResultSet<R>
Trait Implementations§
Source§impl<R: View> Signal for ResultSet<R>
impl<R: View> Signal for ResultSet<R>
Source§fn listen(&self, listener: Listener) -> ListenerGuard
fn listen(&self, listener: Listener) -> ListenerGuard
Listen to changes to this signal with a listener function
Takes an Arc-wrapped closure for efficiency - wrap your closure with Arc::new(|| { … })
Source§fn broadcast_id(&self) -> BroadcastId
fn broadcast_id(&self) -> BroadcastId
Get the broadcast identifier for this signal.
Multiple signals may return the same broadcast_id if they share a broadcast.
The broadcast_id remains valid as a deduplication key as long as any ListenerGuard for that broadcast exists.
Auto Trait Implementations§
impl<R> Freeze for ResultSet<R>
impl<R> RefUnwindSafe for ResultSet<R>where
R: RefUnwindSafe,
impl<R> Send for ResultSet<R>where
R: Send,
impl<R> Sync for ResultSet<R>where
R: Sync,
impl<R> Unpin for ResultSet<R>where
R: Unpin,
impl<R> UnwindSafe for ResultSet<R>where
R: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, T> DynSubscribe<T> for Swhere
T: 'static,
S: Subscribe<T>,
impl<S, T> DynSubscribe<T> for Swhere
T: 'static,
S: Subscribe<T>,
fn dyn_subscribe( &self, listener: Box<dyn Fn(T) + Sync + Send>, ) -> SubscriptionGuard
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.