pub struct Reference {
pub id: String,
pub ref_type: Option<String>,
}Expand description
Reference to another record in the document
Fields§
§id: String§ref_type: Option<String>Implementations§
Source§impl Reference
impl Reference
Sourcepub fn with_type(id: impl Into<String>, ref_type: impl Into<String>) -> Self
pub fn with_type(id: impl Into<String>, ref_type: impl Into<String>) -> Self
Create a new typed reference
Sourcepub fn is_relationship(&self) -> bool
pub fn is_relationship(&self) -> bool
Check if this is a relationship reference (UPPERCASE type)
Sourcepub fn get_namespace(&self) -> Option<&str>
pub fn get_namespace(&self) -> Option<&str>
Get namespace (for non-relationship references)
Sourcepub fn relationship_type(&self) -> Option<&str>
pub fn relationship_type(&self) -> Option<&str>
Get relationship type (for relationship references)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Reference
impl<'de> Deserialize<'de> for Reference
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 StructuralPartialEq for Reference
Auto Trait Implementations§
impl Freeze for Reference
impl RefUnwindSafe for Reference
impl Send for Reference
impl Sync for Reference
impl Unpin for Reference
impl UnwindSafe for Reference
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