pub struct IdentityStub { /* private fields */ }Expand description
A identity stub is what we actually commit in the repository.
This is an almost empty Identity, holding
only the Id. When a normal Identity is serialized into
JSON, only the Id is serialized. All the other data is
stored in git as a normal Entity.
Thus, when the JSON representation is deserialized, an IdentityStub is
used instead, allowing us to lazy load the proper
Identity later.
Implementations§
Source§impl IdentityStub
impl IdentityStub
Sourcepub fn id(&self) -> EntityId<Identity>
pub fn id(&self) -> EntityId<Identity>
Access the id of this IdentityStub.
Source§impl IdentityStub
impl IdentityStub
Sourcepub fn as_value(&self) -> Value<'_>
pub fn as_value(&self) -> Value<'_>
Turn this IdentityStub into it’s JSON value representation.
Sourcepub fn from_value(value: &Value<'_, '_, '_>) -> Result<Self, Error>
pub fn from_value(value: &Value<'_, '_, '_>) -> Result<Self, Error>
Try to parse this IdentityStub from it’s JSON value representation.
§Errors
If the value was did not actually represent an IdentityStub.
Trait Implementations§
Source§impl Clone for IdentityStub
impl Clone for IdentityStub
Source§fn clone(&self) -> IdentityStub
fn clone(&self) -> IdentityStub
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 Debug for IdentityStub
impl Debug for IdentityStub
Source§impl<'de> Deserialize<'de> for IdentityStub
impl<'de> Deserialize<'de> for IdentityStub
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for IdentityStub
impl Ord for IdentityStub
Source§fn cmp(&self, other: &IdentityStub) -> Ordering
fn cmp(&self, other: &IdentityStub) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for IdentityStub
impl PartialEq for IdentityStub
Source§impl PartialOrd for IdentityStub
impl PartialOrd for IdentityStub
Source§impl Serialize for IdentityStub
impl Serialize for IdentityStub
impl Copy for IdentityStub
impl Eq for IdentityStub
impl StructuralPartialEq for IdentityStub
Auto Trait Implementations§
impl Freeze for IdentityStub
impl RefUnwindSafe for IdentityStub
impl Send for IdentityStub
impl Sync for IdentityStub
impl Unpin for IdentityStub
impl UnwindSafe for IdentityStub
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.