pub struct Attrs<I = usize, K = Undirected> { /* private fields */ }
Expand description
Attrs
is a generic implementation of the GraphProps
trait,
enabling the definition of hypergraphs with different index types and graph kinds
(i.e., Directed
or Undirected
).
Implementations§
Source§impl<I, K> Attrs<I, K>
impl<I, K> Attrs<I, K>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
returns a new instance of Attrs
initialized with the given index and kind.
Sourcepub fn with_kind<K2>(self) -> Attrs<I, K2>where
K2: GraphType,
pub fn with_kind<K2>(self) -> Attrs<I, K2>where
K2: GraphType,
consumes the current instance to create another with the given kind
Sourcepub fn with_index<I2>(self) -> Attrs<I2, K>where
I2: RawIndex,
pub fn with_index<I2>(self) -> Attrs<I2, K>where
I2: RawIndex,
consumes the current instance to create another with the given index type
Sourcepub fn is_kind<K2: 'static>(&self) -> boolwhere
K: GraphType,
pub fn is_kind<K2: 'static>(&self) -> boolwhere
K: GraphType,
returns true if the current kind K
is the same as the given kind K2
Sourcepub fn is_index<I2: 'static>(&self) -> boolwhere
I: RawIndex,
pub fn is_index<I2: 'static>(&self) -> boolwhere
I: RawIndex,
returns true if the current index type I
is the same as the given index type I2
Sourcepub fn is_directed(&self) -> boolwhere
K: GraphType,
pub fn is_directed(&self) -> boolwhere
K: GraphType,
returns true if the current kind is Directed
Sourcepub fn is_undirected(&self) -> boolwhere
K: GraphType,
pub fn is_undirected(&self) -> boolwhere
K: GraphType,
returns true if the current kind is Undirected
Source§impl<I> Attrs<I, Undirected>where
I: RawIndex,
impl<I> Attrs<I, Undirected>where
I: RawIndex,
Sourcepub const fn undirected() -> Self
pub const fn undirected() -> Self
initializes a new instance of Attrs
with the kind set to Undirected
.
Trait Implementations§
Source§impl<'de, I, K> Deserialize<'de> for Attrs<I, K>
impl<'de, I, K> Deserialize<'de> for Attrs<I, K>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<I, K> GraphProps for Attrs<I, K>
impl<I, K> GraphProps for Attrs<I, K>
type Ix = I
type Kind = K
Source§fn phantom() -> PhantomData<(Self::Kind, Self::Ix)>
fn phantom() -> PhantomData<(Self::Kind, Self::Ix)>
returns a
PhantomData
instance of the graph attributes.Source§fn into_phantom(self) -> PhantomData<(Self::Kind, Self::Ix)>
fn into_phantom(self) -> PhantomData<(Self::Kind, Self::Ix)>
convert the current attributes into a
PhantomData
instance.Source§fn is_directed(&self) -> bool
fn is_directed(&self) -> bool
returns true if the attributes are directed.
Source§fn is_undirected(&self) -> bool
fn is_undirected(&self) -> bool
returns true if the attributes are undirected.
Source§impl<I: Ord, K: Ord> Ord for Attrs<I, K>
impl<I: Ord, K: Ord> Ord for Attrs<I, K>
1.21.0 · 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
Source§impl<I: PartialOrd, K: PartialOrd> PartialOrd for Attrs<I, K>
impl<I: PartialOrd, K: PartialOrd> PartialOrd for Attrs<I, K>
impl<I, K> Copy for Attrs<I, K>
impl<I: Eq, K: Eq> Eq for Attrs<I, K>
impl<I, K> Send for Attrs<I, K>
impl<I, K> StructuralPartialEq for Attrs<I, K>
impl<I, K> Sync for Attrs<I, K>
Auto Trait Implementations§
impl<I, K> Freeze for Attrs<I, K>
impl<I, K> RefUnwindSafe for Attrs<I, K>where
I: RefUnwindSafe,
K: RefUnwindSafe,
impl<I, K> Unpin for Attrs<I, K>
impl<I, K> UnwindSafe for Attrs<I, K>where
I: UnwindSafe,
K: UnwindSafe,
Blanket Implementations§
Source§impl<T> AsWeight<T> for Twhere
T: Clone + IntoWeight<T>,
impl<T> AsWeight<T> for Twhere
T: Clone + IntoWeight<T>,
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