Struct biodivine_lib_param_bn::VariableId
source · pub struct VariableId(/* private fields */);
Expand description
A type-safe index of a Variable
inside a RegulatoryGraph
(or a BooleanNetwork
).
If needed, it can be converted into usize
for serialisation and safely read
again by providing the original RegulatoryGraph
as context
to the VariableId::try_from_usize
.
Warning: Do not mix type-safe indices between different networks/graphs!
Implementations§
source§impl VariableId
impl VariableId
sourcepub fn try_from_usize(
context: &RegulatoryGraph,
value: usize
) -> Option<VariableId>
pub fn try_from_usize( context: &RegulatoryGraph, value: usize ) -> Option<VariableId>
Try to construct a VariableId
from the given usize
value. The id must be valid
inside the context of the specified RegulatoryGraph
, otherwise None
is returned.
sourcepub fn from_index(value: usize) -> VariableId
pub fn from_index(value: usize) -> VariableId
Create a VariableId
from a constant value without any sanity checks.
Trait Implementations§
source§impl Clone for VariableId
impl Clone for VariableId
source§fn clone(&self) -> VariableId
fn clone(&self) -> VariableId
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for VariableId
impl Debug for VariableId
source§impl Display for VariableId
impl Display for VariableId
source§impl From<VariableId> for usize
impl From<VariableId> for usize
source§fn from(value: VariableId) -> Self
fn from(value: VariableId) -> Self
Converts to this type from the input type.
source§impl Hash for VariableId
impl Hash for VariableId
source§impl Index<VariableId> for BooleanNetwork
impl Index<VariableId> for BooleanNetwork
Allow indexing BooleanNetwork
using VariableId
objects.
source§impl Index<VariableId> for RegulatoryGraph
impl Index<VariableId> for RegulatoryGraph
Allow indexing RegulatoryGraph
using VariableId
objects.
source§impl Index<VariableId> for Space
impl Index<VariableId> for Space
§type Output = ExtendedBoolean
type Output = ExtendedBoolean
The returned type after indexing.
source§impl IndexMut<VariableId> for Space
impl IndexMut<VariableId> for Space
source§impl Ord for VariableId
impl Ord for VariableId
source§fn cmp(&self, other: &VariableId) -> Ordering
fn cmp(&self, other: &VariableId) -> Ordering
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 PartialEq for VariableId
impl PartialEq for VariableId
source§fn eq(&self, other: &VariableId) -> bool
fn eq(&self, other: &VariableId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for VariableId
impl PartialOrd for VariableId
source§fn partial_cmp(&self, other: &VariableId) -> Option<Ordering>
fn partial_cmp(&self, other: &VariableId) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for VariableId
impl Eq for VariableId
impl StructuralPartialEq for VariableId
Auto Trait Implementations§
impl Freeze for VariableId
impl RefUnwindSafe for VariableId
impl Send for VariableId
impl Sync for VariableId
impl Unpin for VariableId
impl UnwindSafe for VariableId
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