EdgeRef

Struct EdgeRef 

Source
pub struct EdgeRef<'a, NodeKey: Hash + Eq + Clone, NodeData: Clone, EdgeKey: Hash + Eq + Clone, EdgeData: Clone> { /* private fields */ }
Expand description

Reference to an edge in a MapGraph

The library guarantees that this references a valid node

Implementations§

Source§

impl<'a, NodeKey: Hash + Eq + Clone, NodeData: Clone, EdgeKey: Hash + Eq + Clone, EdgeData: Clone> EdgeRef<'a, NodeKey, NodeData, EdgeKey, EdgeData>

Source

pub fn data(&self) -> &'a EdgeData

The data associated with this edge

(aka the edge weight)

Source

pub fn key(&self) -> &'a EdgeKey

The edge’s identifier

You can use this to later reference the edge in the graph (if it still exists)

Source

pub fn get_from_node(&self) -> NodeRef<'a, NodeKey, NodeData, EdgeKey, EdgeData>

Reference to the Node from which the edge starts

(aka the tail of the arc)

Source

pub fn get_to_node(&self) -> NodeRef<'a, NodeKey, NodeData, EdgeKey, EdgeData>

Reference to the Node the edge points to

(aka the head of the arc)

Trait Implementations§

Source§

impl<'a, NodeKey: Clone + Hash + Eq + Clone, NodeData: Clone + Clone, EdgeKey: Clone + Hash + Eq + Clone, EdgeData: Clone + Clone> Clone for EdgeRef<'a, NodeKey, NodeData, EdgeKey, EdgeData>

Source§

fn clone(&self) -> EdgeRef<'a, NodeKey, NodeData, EdgeKey, EdgeData>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, NodeKey: Debug + Hash + Eq + Clone, NodeData: Debug + Clone, EdgeKey: Debug + Hash + Eq + Clone, EdgeData: Debug + Clone> Debug for EdgeRef<'a, NodeKey, NodeData, EdgeKey, EdgeData>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, NodeKey: Copy + Hash + Eq + Clone, NodeData: Copy + Clone, EdgeKey: Copy + Hash + Eq + Clone, EdgeData: Copy + Clone> Copy for EdgeRef<'a, NodeKey, NodeData, EdgeKey, EdgeData>

Auto Trait Implementations§

§

impl<'a, NodeKey, NodeData, EdgeKey, EdgeData> Freeze for EdgeRef<'a, NodeKey, NodeData, EdgeKey, EdgeData>

§

impl<'a, NodeKey, NodeData, EdgeKey, EdgeData> RefUnwindSafe for EdgeRef<'a, NodeKey, NodeData, EdgeKey, EdgeData>
where NodeKey: RefUnwindSafe, NodeData: RefUnwindSafe, EdgeKey: RefUnwindSafe, EdgeData: RefUnwindSafe,

§

impl<'a, NodeKey, NodeData, EdgeKey, EdgeData> Send for EdgeRef<'a, NodeKey, NodeData, EdgeKey, EdgeData>
where NodeKey: Sync + Send, NodeData: Sync + Send, EdgeKey: Sync + Send, EdgeData: Sync + Send,

§

impl<'a, NodeKey, NodeData, EdgeKey, EdgeData> Sync for EdgeRef<'a, NodeKey, NodeData, EdgeKey, EdgeData>
where NodeKey: Sync + Send, NodeData: Sync + Send, EdgeKey: Sync + Send, EdgeData: Sync + Send,

§

impl<'a, NodeKey, NodeData, EdgeKey, EdgeData> Unpin for EdgeRef<'a, NodeKey, NodeData, EdgeKey, EdgeData>

§

impl<'a, NodeKey, NodeData, EdgeKey, EdgeData> UnwindSafe for EdgeRef<'a, NodeKey, NodeData, EdgeKey, EdgeData>
where NodeKey: RefUnwindSafe, NodeData: RefUnwindSafe, EdgeKey: RefUnwindSafe, EdgeData: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.