pub struct EntitySnapshot { /* private fields */ }Expand description
An immutable snapshot of an entity’s scalar property values.
Constructed by IEntitySnapshot::snapshot() and IGetKeyValues::key_values().
Field lookups via get are O(n) linear scans — for the typical
5–10 field entity this is faster than HashMap allocation + hashing.
Implementations§
Source§impl EntitySnapshot
impl EntitySnapshot
Sourcepub fn new(entries: Vec<(&'static str, DbValue)>) -> Self
pub fn new(entries: Vec<(&'static str, DbValue)>) -> Self
Creates a snapshot from a vector of (field_name, value) pairs.
Sourcepub fn get(&self, field: &str) -> Option<&DbValue>
pub fn get(&self, field: &str) -> Option<&DbValue>
Looks up a value by field name. O(n) linear scan.
Trait Implementations§
Source§impl Clone for EntitySnapshot
impl Clone for EntitySnapshot
Source§fn clone(&self) -> EntitySnapshot
fn clone(&self) -> EntitySnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EntitySnapshot
impl Debug for EntitySnapshot
Source§impl Default for EntitySnapshot
impl Default for EntitySnapshot
Auto Trait Implementations§
impl Freeze for EntitySnapshot
impl RefUnwindSafe for EntitySnapshot
impl Send for EntitySnapshot
impl Sync for EntitySnapshot
impl Unpin for EntitySnapshot
impl UnsafeUnpin for EntitySnapshot
impl UnwindSafe for EntitySnapshot
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