pub struct EntityReference {
pub type: String,
pub entity: EntityId,
pub entity_type: Option<EntityType>,
pub name: Option<String>,
pub role: Option<String>,
}Expand description
Closed pointer to an entity mentioned by a MIF memory.
Corresponds to schema/definitions/entity-reference.schema.json. See
EntityData for the open-payload counterpart used when a memory is
an entity, rather than merely mentioning one.
Fields§
§type: StringJSON-LD type marker. Always "EntityReference".
entity: EntityIdThe entity’s identifier.
entity_type: Option<EntityType>Entity type classification.
name: Option<String>Display name for the entity.
role: Option<String>Role of the entity in the memory context (e.g. author, subject, topic).
Implementations§
Source§impl EntityReference
impl EntityReference
Sourcepub fn new(id: String) -> Self
pub fn new(id: String) -> Self
Creates a new reference to the entity identified by id
(e.g. urn:mif:entity:person:jane-smith).
Sourcepub fn with_entity_type(self, entity_type: EntityType) -> Self
pub fn with_entity_type(self, entity_type: EntityType) -> Self
Sets the entity type classification.
Trait Implementations§
Source§impl Clone for EntityReference
impl Clone for EntityReference
Source§fn clone(&self) -> EntityReference
fn clone(&self) -> EntityReference
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 EntityReference
impl Debug for EntityReference
Source§impl<'de> Deserialize<'de> for EntityReference
impl<'de> Deserialize<'de> for EntityReference
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
impl Eq for EntityReference
Source§impl PartialEq for EntityReference
impl PartialEq for EntityReference
Source§fn eq(&self, other: &EntityReference) -> bool
fn eq(&self, other: &EntityReference) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EntityReference
impl Serialize for EntityReference
impl StructuralPartialEq for EntityReference
Auto Trait Implementations§
impl Freeze for EntityReference
impl RefUnwindSafe for EntityReference
impl Send for EntityReference
impl Sync for EntityReference
impl Unpin for EntityReference
impl UnsafeUnpin for EntityReference
impl UnwindSafe for EntityReference
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<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.