pub struct Edge {
pub source: String,
pub target: String,
pub metadata: Metadata,
}Expand description
A directed edge from source to target (both node-identity paths).
Fields§
§source: String§target: String§metadata: MetadataImplementations§
Source§impl Edge
impl Edge
Sourcepub fn new(source: impl Into<String>, target: impl Into<String>) -> Self
pub fn new(source: impl Into<String>, target: impl Into<String>) -> Self
An edge from source to target with no metadata.
Sourcepub fn with_metadata(
source: impl Into<String>,
target: impl Into<String>,
metadata: Metadata,
) -> Self
pub fn with_metadata( source: impl Into<String>, target: impl Into<String>, metadata: Metadata, ) -> Self
An edge from source to target carrying the given metadata.
Sourcepub fn lines(&self) -> Vec<usize>
pub fn lines(&self) -> Vec<usize>
The source line(s) where this edge’s link appears, unioned across parser
namespaces (@markdown, @frontmatter, …) and sorted/deduped. Empty when
no parser recorded a line. The link lives in source, so these are
positions within source.
Sourcepub fn raw_links(&self) -> Vec<&str>
pub fn raw_links(&self) -> Vec<&str>
The literal link text(s) that produced this edge, across contributing
graphs. Present only where resolution moved the path, so an edge whose
target is exactly what the author typed reports nothing. Two graphs can
disagree — one doc may write ./x.md where another writes x.md.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Edge
impl<'de> Deserialize<'de> for Edge
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 Edge
Auto Trait Implementations§
impl Freeze for Edge
impl RefUnwindSafe for Edge
impl Send for Edge
impl Sync for Edge
impl Unpin for Edge
impl UnsafeUnpin for Edge
impl UnwindSafe for Edge
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