pub struct Graph {
pub by_id: HashMap<String, usize>,
pub by_path: HashMap<String, usize>,
pub by_alias: HashMap<String, Vec<usize>>,
pub anchors: Vec<HashSet<String>>,
pub edges: Vec<Edge>,
pub outgoing: Vec<Vec<usize>>,
pub incoming: Vec<Vec<usize>>,
}Fields§
§by_id: HashMap<String, usize>§by_path: HashMap<String, usize>§by_alias: HashMap<String, Vec<usize>>§anchors: Vec<HashSet<String>>§edges: Vec<Edge>§outgoing: Vec<Vec<usize>>§incoming: Vec<Vec<usize>>Implementations§
Source§impl Graph
impl Graph
pub fn build(c: &Corpus) -> Self
Sourcepub fn resolve(&self, text: &str) -> Resolution
pub fn resolve(&self, text: &str) -> Resolution
Resolves an id, an alias, or a path to a document, checking the anchor if there is one.
pub fn edges_from(&self, idx: usize) -> impl Iterator<Item = &Edge>
pub fn edges_to(&self, idx: usize) -> impl Iterator<Item = &Edge>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Graph
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnsafeUnpin for Graph
impl UnwindSafe for Graph
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more