pub struct SharedEntity { /* private fields */ }Expand description
One copy of a cached entity: fields shared with every other copy that has
the same ones, plus this copy’s _version.
It reads and compares as the whole entity it stands for, _version
included: Self::to_value rebuilds that entity, and equality, field
access (EntityFields) and indexing see it too. It serializes exactly as
that entity does, without rebuilding it.
Implementations§
Whether other shares this entity’s fields rather than holding a copy
of its own. Sharing says nothing about _version.
Sourcepub fn into_value(self) -> Value
pub fn into_value(self) -> Value
The whole entity, copying the fields only if another holder shares them.
Trait Implementations§
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§fn from(entity: SharedEntity) -> Self
fn from(entity: SharedEntity) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
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