pub struct SpeciesReference {
pub species: String,
pub constant: bool,
pub sbo_term: Option<String>,
pub id: Option<String>,
pub name: Option<String>,
pub stoichiometry: Option<f64>,
}
Expand description
Provide a way for reactions to define species as products and reactants.
§Example
use quick_xml::de::from_str;
use rust_sbml::Reaction;
let reactions: Reaction = from_str(
"<reaction id='J1' reversible='false' fbc:lowerFluxBound='-20'>
<listOfReactants>
<speciesReference species='X0' stoichiometry='2' constant='true'/>
<speciesReference species='X1' stoichiometry='1' constant='true'/>
</listOfReactants></reaction></listOfReactions></model>",
)
.unwrap();
println!("{:?}", reactions);
let mut specs_ref = reactions
.list_of_reactants
.species_references
.iter();
assert!(specs_ref
.any(|specref| specref.species == "X0"));
assert!(specs_ref
.any(|specref| {println!("{:?}", specref); specref.stoichiometry.unwrap() as i32 == 1}));
assert!(specs_ref
.all(|specref| specref.constant));
Fields§
§species: String
§constant: bool
§sbo_term: Option<String>
§id: Option<String>
§name: Option<String>
§stoichiometry: Option<f64>
Trait Implementations§
Source§impl Clone for SpeciesReference
impl Clone for SpeciesReference
Source§fn clone(&self) -> SpeciesReference
fn clone(&self) -> SpeciesReference
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 SpeciesReference
impl Debug for SpeciesReference
Source§impl<'de> Deserialize<'de> for SpeciesReference
impl<'de> Deserialize<'de> for SpeciesReference
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 PartialEq for SpeciesReference
impl PartialEq for SpeciesReference
Source§impl PyClass for SpeciesReference
impl PyClass for SpeciesReference
Source§type Dict = PyClassDummySlot
type Dict = PyClassDummySlot
Specify this class has
#[pyclass(dict)]
or not.Source§type WeakRef = PyClassDummySlot
type WeakRef = PyClassDummySlot
Specify this class has
#[pyclass(weakref)]
or not.Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.Source§impl PyClassDescriptors<SpeciesReference> for PyClassImplCollector<SpeciesReference>
impl PyClassDescriptors<SpeciesReference> for PyClassImplCollector<SpeciesReference>
fn py_class_descriptors(self) -> &'static [PyMethodDefType]
Source§impl PyClassImpl for SpeciesReference
impl PyClassImpl for SpeciesReference
Source§const DOC: &'static str = /// Provide a way for reactions to define species as products and reactants.
const DOC: &'static str = /// Provide a way for reactions to define species as products and reactants.
Class doc string
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§type Layout = PyCell<SpeciesReference>
type Layout = PyCell<SpeciesReference>
Layout
Source§type ThreadChecker = ThreadCheckerStub<SpeciesReference>
type ThreadChecker = ThreadCheckerStub<SpeciesReference>
This handles following two situations: Read more
fn for_each_method_def(visitor: &mut dyn FnMut(&[PyMethodDefType]))
fn get_new() -> Option<newfunc>
fn get_alloc() -> Option<allocfunc>
fn get_free() -> Option<freefunc>
fn get_call() -> Option<PyCFunctionWithKeywords>
fn for_each_proto_slot(visitor: &mut dyn FnMut(&[PyType_Slot]))
fn get_buffer() -> Option<&'static PyBufferProcs>
Source§impl PyMethods<SpeciesReference> for PyClassImplCollector<SpeciesReference>
impl PyMethods<SpeciesReference> for PyClassImplCollector<SpeciesReference>
fn py_methods(self) -> &'static [PyMethodDefType]
Source§impl PyTypeInfo for SpeciesReference
impl PyTypeInfo for SpeciesReference
Source§type AsRefTarget = PyCell<SpeciesReference>
type AsRefTarget = PyCell<SpeciesReference>
Utility type to make Py::as_ref work.
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
PyTypeObject instance for this type.
Source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type or a subclass of this type.Source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type.Source§impl Serialize for SpeciesReference
impl Serialize for SpeciesReference
impl StructuralPartialEq for SpeciesReference
Auto Trait Implementations§
impl Freeze for SpeciesReference
impl RefUnwindSafe for SpeciesReference
impl Send for SpeciesReference
impl Sync for SpeciesReference
impl Unpin for SpeciesReference
impl UnwindSafe for SpeciesReference
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<'a, T> FromPyObject<'a> for T
impl<'a, T> FromPyObject<'a> for T
Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> PyTypeObject for Twhere
T: PyTypeInfo,
impl<T> PyTypeObject for Twhere
T: PyTypeInfo,
Source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.