#[repr(transparent)]pub struct LinkIndex(pub u32);
Expand description
Index of a link in a hugr graph.
Tuple Fields§
§0: u32
Implementations§
Source§impl LinkIndex
impl LinkIndex
Sourcepub fn index(self) -> usize
pub fn index(self) -> usize
Returns the index as a usize
to conveniently use it as a slice index.
Sourcepub fn unwrap_slice(slice: &[Self]) -> &[u32]
pub fn unwrap_slice(slice: &[Self]) -> &[u32]
Convert a slice of this index type into a slice of u32
s.
Sourcepub fn wrap_slice(slice: &[u32]) -> &[Self]
pub fn wrap_slice(slice: &[u32]) -> &[Self]
Convert a slice of u32
s into a slice of this index type.
Trait Implementations§
Source§impl Ord for LinkIndex
impl Ord for LinkIndex
Source§impl PartialOrd for LinkIndex
impl PartialOrd for LinkIndex
impl Copy for LinkIndex
impl Eq for LinkIndex
impl StructuralPartialEq for LinkIndex
Auto Trait Implementations§
impl Freeze for LinkIndex
impl RefUnwindSafe for LinkIndex
impl Send for LinkIndex
impl Sync for LinkIndex
impl Unpin for LinkIndex
impl UnwindSafe for LinkIndex
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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