pub struct Edge<Idx = DefaultIx, W = ()> {
pub link: Link<Idx>,
pub weight: Option<W>,
/* private fields */
}
Fields§
§link: Link<Idx>
§weight: Option<W>
Implementations§
Source§impl<Idx, W> Edge<Idx, W>
impl<Idx, W> Edge<Idx, W>
pub fn new( src: NodeIndex<Idx>, target: NodeIndex<Idx>, weight: Option<W>, ) -> Self
pub fn from_link(link: Link<Idx>) -> Self
pub fn unweighted(src: NodeIndex<Idx>, target: NodeIndex<Idx>) -> Self
pub fn weighted(src: NodeIndex<Idx>, target: NodeIndex<Idx>, weight: W) -> Self
pub fn with_weight(self, weight: W) -> Self
pub fn is_unweighted(&self) -> bool
pub fn is_weighted(&self) -> bool
pub fn weight(&self) -> Option<&W>
pub fn weight_mut(&mut self) -> Option<&mut W>
Trait Implementations§
Auto Trait Implementations§
impl<Idx, W> Freeze for Edge<Idx, W>
impl<Idx, W> RefUnwindSafe for Edge<Idx, W>where
W: RefUnwindSafe,
Idx: RefUnwindSafe,
impl<Idx, W> Send for Edge<Idx, W>
impl<Idx, W> Sync for Edge<Idx, W>
impl<Idx, W> Unpin for Edge<Idx, W>
impl<Idx, W> UnwindSafe for Edge<Idx, W>where
W: UnwindSafe,
Idx: UnwindSafe,
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