pub struct Graph {
pub by_id: HashMap<String, usize>,
pub by_path: HashMap<String, usize>,
pub by_alias: HashMap<String, Vec<usize>>,
pub by_slug: HashMap<String, Vec<usize>>,
pub owners: Vec<String>,
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>>§by_slug: HashMap<String, Vec<usize>>Slug ids (plan:root/payment-rollout), resolved like aliases.
owners: Vec<String>The owner of each document, from its id.
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.
Sourcepub fn resolve_from(&self, owner: &str, text: &str) -> Resolution
pub fn resolve_from(&self, owner: &str, text: &str) -> Resolution
Resolves as written by owner: an alias or slug several owners declare names that owner’s
document when exactly one of the candidates is its own.
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 Forget for Graph
impl Freeze for Graph
impl Move 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