Struct biodivine_lib_param_bn::VariableId
source · [−]pub struct VariableId(pub(crate) usize);
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!
Tuple Fields
0: usize
Implementations
sourceimpl 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.
Trait Implementations
sourceimpl Clone for VariableId
impl Clone for VariableId
sourcefn clone(&self) -> VariableId
fn clone(&self) -> VariableId
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for VariableId
impl Debug for VariableId
sourceimpl Display for VariableId
impl Display for VariableId
sourceimpl From<VariableId> for usize
impl From<VariableId> for usize
sourcefn from(value: VariableId) -> Self
fn from(value: VariableId) -> Self
Performs the conversion.
sourceimpl Hash for VariableId
impl Hash for VariableId
sourceimpl Index<VariableId> for BooleanNetwork
impl Index<VariableId> for BooleanNetwork
Allow indexing BooleanNetwork
using VariableId
objects.
sourceimpl Index<VariableId> for RegulatoryGraph
impl Index<VariableId> for RegulatoryGraph
Allow indexing RegulatoryGraph
using VariableId
objects.
sourceimpl Ord for VariableId
impl Ord for VariableId
sourceimpl PartialEq<VariableId> for VariableId
impl PartialEq<VariableId> for VariableId
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &VariableId) -> bool
fn ne(&self, other: &VariableId) -> bool
This method tests for !=
.
sourceimpl PartialOrd<VariableId> for VariableId
impl PartialOrd<VariableId> for VariableId
sourcefn partial_cmp(&self, other: &VariableId) -> Option<Ordering>
fn partial_cmp(&self, other: &VariableId) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl Copy for VariableId
impl Eq for VariableId
impl StructuralEq for VariableId
impl StructuralPartialEq for VariableId
Auto Trait Implementations
impl RefUnwindSafe for VariableId
impl Send for VariableId
impl Sync for VariableId
impl Unpin for VariableId
impl UnwindSafe for VariableId
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more