pub struct LinkDefinition {
pub link_type: String,
pub source_type: String,
pub target_type: String,
pub forward_route_name: String,
pub reverse_route_name: String,
pub description: Option<String>,
pub required_fields: Option<Vec<String>>,
pub auth: Option<LinkAuthConfig>,
}Expand description
Configuration for a specific type of link between two entity types
Fields§
§link_type: StringThe type of link (e.g., “owner”, “driver”)
source_type: StringThe source entity type (e.g., “user”)
target_type: StringThe target entity type (e.g., “car”)
forward_route_name: StringRoute name when navigating from source to target
reverse_route_name: StringRoute name when navigating from target to source
description: Option<String>Optional description of this link type
required_fields: Option<Vec<String>>Optional list of required metadata fields
auth: Option<LinkAuthConfig>Authorization configuration specific to this link type
Implementations§
Source§impl LinkDefinition
impl LinkDefinition
Sourcepub fn default_forward_route_name(target_type: &str, link_type: &str) -> String
pub fn default_forward_route_name(target_type: &str, link_type: &str) -> String
Generate the default forward route name
Sourcepub fn default_reverse_route_name(source_type: &str, link_type: &str) -> String
pub fn default_reverse_route_name(source_type: &str, link_type: &str) -> String
Generate the default reverse route name
Trait Implementations§
Source§impl Clone for LinkDefinition
impl Clone for LinkDefinition
Source§fn clone(&self) -> LinkDefinition
fn clone(&self) -> LinkDefinition
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 LinkDefinition
impl Debug for LinkDefinition
Source§impl<'de> Deserialize<'de> for LinkDefinition
impl<'de> Deserialize<'de> for LinkDefinition
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 LinkDefinition
impl RefUnwindSafe for LinkDefinition
impl Send for LinkDefinition
impl Sync for LinkDefinition
impl Unpin for LinkDefinition
impl UnwindSafe for LinkDefinition
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