Struct rust_sbml::SpeciesReference[][src]

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>,
}

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: Stringconstant: boolsbo_term: Option<String>id: Option<String>name: Option<String>stoichiometry: Option<f64>

Trait Implementations

impl Clone for SpeciesReference[src]

impl Debug for SpeciesReference[src]

impl<'de> Deserialize<'de> for SpeciesReference[src]

impl<'a> ExtractExt<'a> for &'a SpeciesReference[src]

impl<'a> ExtractExt<'a> for &'a mut SpeciesReference[src]

impl HasMethodsInventory for SpeciesReference[src]

type Methods = Pyo3MethodsInventoryForSpeciesReference

impl IntoPy<Py<PyAny>> for SpeciesReference[src]

impl PartialEq<SpeciesReference> for SpeciesReference[src]

impl PyClass for SpeciesReference[src]

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict. Read more

impl PyClassAlloc for SpeciesReference[src]

impl PyClassSend for SpeciesReference[src]

type ThreadChecker = ThreadCheckerStub<SpeciesReference>

impl PyProtoMethods for SpeciesReference[src]

impl PyTypeInfo for SpeciesReference[src]

type Type = SpeciesReference

Type of objects to store in PyObject struct

type BaseType = PyAny

Base class

type Layout = PyCell<Self>

Layout

type BaseLayout = PyCellBase<PyAny>

Layout of Basetype.

type Initializer = PyClassInitializer<Self>

Initializer for layout

type AsRefTarget = PyCell<Self>

Utility type to make Py::as_ref work

impl Serialize for SpeciesReference[src]

impl StructuralPartialEq for SpeciesReference[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<'a, T> FromPyObject<'a> for T where
    T: PyClass + Clone
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> PyErrArguments for T where
    T: IntoPy<Py<PyAny>> + Send + Sync
[src]

impl<T> PyTypeObject for T where
    T: PyTypeInfo
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.