pub struct Link {
pub id: String,
pub from_ref: String,
pub link_type: String,
pub to_ref: String,
pub weight: Option<f64>,
pub metadata_json: String,
pub created_at: String,
}Expand description
A graph link connecting two references.
Fields§
§id: StringUnique link identifier.
from_ref: StringSource reference (e.g. “collection/id” or “stream/sequence”).
link_type: StringRelationship type (e.g. “supports”, “depends_on”, “chunk_of”).
to_ref: StringTarget reference.
weight: Option<f64>Optional weight for ranking (0.0 to 1.0).
metadata_json: StringOptional metadata as JSON string.
created_at: StringISO 8601 creation timestamp.
Implementations§
Source§impl Link
impl Link
Sourcepub fn new(
from_ref: impl Into<String>,
link_type: impl Into<String>,
to_ref: impl Into<String>,
) -> Self
pub fn new( from_ref: impl Into<String>, link_type: impl Into<String>, to_ref: impl Into<String>, ) -> Self
Create a new graph link.
Sourcepub const fn with_weight(self, weight: f64) -> Self
pub const fn with_weight(self, weight: f64) -> Self
Set the link weight.
Sourcepub fn with_metadata(self, metadata: impl Into<String>) -> Self
pub fn with_metadata(self, metadata: impl Into<String>) -> Self
Set the metadata JSON.
Trait Implementations§
impl StructuralPartialEq for Link
Auto Trait Implementations§
impl Freeze for Link
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnsafeUnpin for Link
impl UnwindSafe for Link
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