pub struct DirectLinkExtractor {
pub source_id: Uuid,
pub source_type: String,
pub target_id: Uuid,
pub target_type: String,
pub link_definition: LinkDefinition,
pub direction: LinkDirection,
}Expand description
Extractor for direct link creation/deletion/update
Format: /{source_type}/{source_id}/{route_name}/{target_id}
Example: /users/123.../cars-owned/456...
This uses the route_name (e.g., “cars-owned”) instead of link_type (e.g., “owner”) to provide more semantic and RESTful URLs.
Fields§
§source_id: Uuid§source_type: String§target_id: Uuid§target_type: String§link_definition: LinkDefinition§direction: LinkDirectionImplementations§
Source§impl DirectLinkExtractor
impl DirectLinkExtractor
Sourcepub fn from_path(
path_parts: (String, Uuid, String, Uuid),
registry: &LinkRouteRegistry,
config: &LinksConfig,
) -> Result<Self, ExtractorError>
pub fn from_path( path_parts: (String, Uuid, String, Uuid), registry: &LinkRouteRegistry, config: &LinksConfig, ) -> Result<Self, ExtractorError>
Parse a direct link path using route_name
path_parts = (source_type_plural, source_id, route_name, target_id)
The route_name is resolved to a link definition using the LinkRouteRegistry, which handles both forward and reverse navigation automatically.
Trait Implementations§
Source§impl Clone for DirectLinkExtractor
impl Clone for DirectLinkExtractor
Source§fn clone(&self) -> DirectLinkExtractor
fn clone(&self) -> DirectLinkExtractor
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 moreAuto Trait Implementations§
impl Freeze for DirectLinkExtractor
impl RefUnwindSafe for DirectLinkExtractor
impl Send for DirectLinkExtractor
impl Sync for DirectLinkExtractor
impl Unpin for DirectLinkExtractor
impl UnwindSafe for DirectLinkExtractor
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