pub struct EntityRef {
pub entity_type: EntityType,
pub id: Uuid,
}Expand description
A reference to a record that lives in another service, identified by
its entity type and public UUID (pid). Serialises as the single URN
string "<entity_type>:<uuid>".
use entity_ref::{EntityRef, EntityType};
let r: EntityRef = "person:0c4f1e2a-0000-4000-8000-000000000000".parse().unwrap();
assert_eq!(r.entity_type, EntityType::Person);
assert_eq!(r.to_string(), "person:0c4f1e2a-0000-4000-8000-000000000000");Fields§
§entity_type: EntityTypeThe kind of record referenced.
id: UuidThe record’s public UUID (pid).
Implementations§
Trait Implementations§
impl Copy for EntityRef
Source§impl<'de> Deserialize<'de> for EntityRef
impl<'de> Deserialize<'de> for EntityRef
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 EntityRef
impl StructuralPartialEq for EntityRef
Auto Trait Implementations§
impl Freeze for EntityRef
impl RefUnwindSafe for EntityRef
impl Send for EntityRef
impl Sync for EntityRef
impl Unpin for EntityRef
impl UnsafeUnpin for EntityRef
impl UnwindSafe for EntityRef
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