pub struct EntityResultSet<E: AbstractEntity = Entity>(/* private fields */);Implementations§
Source§impl<E: AbstractEntity> EntityResultSet<E>
impl<E: AbstractEntity> EntityResultSet<E>
pub fn from_vec(entities: Vec<E>, loaded: bool) -> Self
pub fn empty() -> Self
pub fn single(entity: E) -> Self
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
Trait Implementations§
Source§impl<E: Clone + AbstractEntity> Clone for EntityResultSet<E>
impl<E: Clone + AbstractEntity> Clone for EntityResultSet<E>
Source§fn clone(&self) -> EntityResultSet<E>
fn clone(&self) -> EntityResultSet<E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<E: Debug + AbstractEntity> Debug for EntityResultSet<E>
impl<E: Debug + AbstractEntity> Debug for EntityResultSet<E>
Source§impl<E: AbstractEntity> Signal for EntityResultSet<E>
impl<E: AbstractEntity> Signal for EntityResultSet<E>
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<E> Freeze for EntityResultSet<E>
impl<E> RefUnwindSafe for EntityResultSet<E>
impl<E> Send for EntityResultSet<E>where
E: Send,
impl<E> Sync for EntityResultSet<E>where
E: Send,
impl<E> Unpin for EntityResultSet<E>
impl<E> UnwindSafe for EntityResultSet<E>
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<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.