#[repr(transparent)]pub struct EdgeTag<'scope, I>(_, pub I);Expand description
A lifetime-parameterized wrapper around edge indices.
EdgeTag ensures that edge references cannot escape the scope they were created in
and cannot be used with different graphs. This provides compile-time safety guarantees
that prevent common graph programming errors.
§Type Parameters
'scope: The lifetime of the scope this tag is valid inI: The underlying index type
§Safety Guarantees
- Scope Safety: Tags cannot escape the scope they were created in
- Graph Safety: Tags from one graph cannot be used with another graph
- Lifetime Safety: Prevents use-after-remove scenarios
Tuple Fields§
§1: IImplementations§
Trait Implementations§
impl<'scope, I: Copy> Copy for EdgeTag<'scope, I>
impl<'scope, I: Eq> Eq for EdgeTag<'scope, I>
Source§impl<'scope, K, V, M: Mapping<K, V>> Index<EdgeTag<'scope, K>> for ContextEdgeMap<'scope, K, V, M>
impl<'scope, K, V, M: Mapping<K, V>> Index<EdgeTag<'scope, K>> for ContextEdgeMap<'scope, K, V, M>
Source§impl<'scope, K, V, M: Mapping<K, V>> IndexMut<EdgeTag<'scope, K>> for ContextEdgeMap<'scope, K, V, M>
impl<'scope, K, V, M: Mapping<K, V>> IndexMut<EdgeTag<'scope, K>> for ContextEdgeMap<'scope, K, V, M>
Source§impl<'scope, K, V, M: Mapping<K, V>> Mapping<EdgeTag<'scope, K>, V> for ContextEdgeMap<'scope, K, V, M>
impl<'scope, K, V, M: Mapping<K, V>> Mapping<EdgeTag<'scope, K>, V> for ContextEdgeMap<'scope, K, V, M>
Source§fn map<VV>(self, f: impl FnMut(V) -> VV) -> impl Mapping<EdgeTag<'scope, K>, VV>
fn map<VV>(self, f: impl FnMut(V) -> VV) -> impl Mapping<EdgeTag<'scope, K>, VV>
Transform this mapping by applying a function to each value. Read more
Source§fn iter<'a>(&'a self) -> impl Iterator<Item = &'a V>where
V: 'a,
fn iter<'a>(&'a self) -> impl Iterator<Item = &'a V>where
V: 'a,
Returns an iterator over references to the values in this mapping. Read more
Source§fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut V>where
V: 'a,
fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut V>where
V: 'a,
Returns an iterator over mutable references to the values in this mapping. Read more
Source§impl<'scope, I: Ord> Ord for EdgeTag<'scope, I>
impl<'scope, I: Ord> Ord for EdgeTag<'scope, I>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<'scope, I: PartialOrd> PartialOrd for EdgeTag<'scope, I>
impl<'scope, I: PartialOrd> PartialOrd for EdgeTag<'scope, I>
impl<'scope, I: PartialEq> StructuralPartialEq for EdgeTag<'scope, I>
Auto Trait Implementations§
impl<'scope, I> Freeze for EdgeTag<'scope, I>where
I: Freeze,
impl<'scope, I> RefUnwindSafe for EdgeTag<'scope, I>where
I: RefUnwindSafe,
impl<'scope, I> Send for EdgeTag<'scope, I>where
I: Send,
impl<'scope, I> Sync for EdgeTag<'scope, I>where
I: Sync,
impl<'scope, I> Unpin for EdgeTag<'scope, I>where
I: Unpin,
impl<'scope, I> UnsafeUnpin for EdgeTag<'scope, I>where
I: UnsafeUnpin,
impl<'scope, I> UnwindSafe for EdgeTag<'scope, I>where
I: 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