pub struct WikiGraph {
pub nodes: HashMap<String, WikiNodeData>,
/* private fields */
}Fields§
§nodes: HashMap<String, WikiNodeData>Implementations§
Source§impl WikiGraph
impl WikiGraph
pub fn new() -> Self
pub fn add_node(&mut self, id: impl Into<String>, data: WikiNodeData)
pub fn add_edge( &mut self, u: impl Into<String>, v: impl Into<String>, data: WikiEdgeData, )
pub fn contains(&self, id: &str) -> bool
pub fn node_count(&self) -> usize
pub fn edge_count(&self) -> usize
pub fn degree(&self, id: &str) -> usize
pub fn neighbors(&self, id: &str) -> Vec<(&str, &WikiEdgeData)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WikiGraph
impl RefUnwindSafe for WikiGraph
impl Send for WikiGraph
impl Sync for WikiGraph
impl Unpin for WikiGraph
impl UnsafeUnpin for WikiGraph
impl UnwindSafe for WikiGraph
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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