#[repr(C)]pub struct Link<T: LinkReference> {
pub index: T,
pub source: T,
pub target: T,
}Expand description
A link triple (index, source, target) that represents one node in the doublets graph.
Every link is uniquely identified by its index and connects a source to a target.
Fields§
§index: TUnique identifier of this link within the store.
source: TThe source (left) endpoint of this link.
target: TThe target (right) endpoint of this link.
Implementations§
Source§impl<T: LinkReference> Link<T>
impl<T: LinkReference> Link<T>
Sourcepub const fn new(index: T, source: T, target: T) -> Self
pub const fn new(index: T, source: T, target: T) -> Self
Creates a new link with the given index, source, and target.
Sourcepub const fn point(val: T) -> Self
pub const fn point(val: T) -> Self
Creates a self-referential (point) link where index == source == target.
Sourcepub const fn from_slice(slice: &[T]) -> Self
pub const fn from_slice(slice: &[T]) -> Self
Sourcepub fn is_full(&self) -> bool
pub fn is_full(&self) -> bool
Returns true if the link is a full point (index == source == target).
Sourcepub fn is_partial(&self) -> bool
pub fn is_partial(&self) -> bool
Returns true if index equals either source or target.
Trait Implementations§
Source§impl<T: LinkReference> Debug for Link<T>
impl<T: LinkReference> Debug for Link<T>
impl<T: Eq + LinkReference> Eq for Link<T>
impl<T: PartialEq + LinkReference> StructuralPartialEq for Link<T>
Auto Trait Implementations§
impl<T> Freeze for Link<T>where
T: Freeze,
impl<T> RefUnwindSafe for Link<T>where
T: RefUnwindSafe,
impl<T> Send for Link<T>
impl<T> Sync for Link<T>
impl<T> Unpin for Link<T>where
T: Unpin,
impl<T> UnsafeUnpin for Link<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Link<T>where
T: 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