pub struct StaticResourceReference {
pub id: String,
pub graph_id: String,
pub resource_type: Option<String>,
pub title: Option<String>,
pub root: Option<Value>,
pub meta: Option<HashMap<String, Value>>,
}Expand description
Reference to another resource instance (for resource-instance datatype)
Used in ResourceInstanceViewModel to represent relationships between resources. Can include the full resource tree if cascade is enabled.
Fields§
§id: StringResource instance ID
graph_id: StringGraph ID for the resource model
resource_type: Option<String>Resource model type/name (optional)
title: Option<String>Display title for the resource (optional)
root: Option<Value>Full resource tree data (when cascaded, optional)
meta: Option<HashMap<String, Value>>Additional metadata (optional)
Implementations§
Source§impl StaticResourceReference
impl StaticResourceReference
Sourcepub fn new(id: String, graph_id: String) -> Self
pub fn new(id: String, graph_id: String) -> Self
Create a minimal resource reference with just ID and graph ID
Sourcepub fn with_type(id: String, graph_id: String, resource_type: String) -> Self
pub fn with_type(id: String, graph_id: String, resource_type: String) -> Self
Create a reference with type information
Sourcepub fn with_title(self, title: String) -> Self
pub fn with_title(self, title: String) -> Self
Add title to reference (builder pattern)
Trait Implementations§
Source§impl Clone for StaticResourceReference
impl Clone for StaticResourceReference
Source§fn clone(&self) -> StaticResourceReference
fn clone(&self) -> StaticResourceReference
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 StaticResourceReference
impl Debug for StaticResourceReference
Source§impl<'de> Deserialize<'de> for StaticResourceReference
impl<'de> Deserialize<'de> for StaticResourceReference
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
Auto Trait Implementations§
impl Freeze for StaticResourceReference
impl RefUnwindSafe for StaticResourceReference
impl Send for StaticResourceReference
impl Sync for StaticResourceReference
impl Unpin for StaticResourceReference
impl UnsafeUnpin for StaticResourceReference
impl UnwindSafe for StaticResourceReference
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