Struct rust_sbml::Compartment[][src]

pub struct Compartment {
    pub units: Option<UnitSIdRef>,
    pub id: String,
    pub name: Option<String>,
    pub sbo_term: Option<String>,
    pub spatial_dimensions: Option<f64>,
    pub size: Option<f64>,
    pub constant: bool,
}

A compartment in SBML represents a bounded space in which species are located.

Example

use quick_xml::de::from_str;
use rust_sbml::Compartment;

let compartments: Vec<Compartment> = from_str(
    "<compartment id='Extracellular' spatialDimensions='3' size='1e-14' constant='true'/>
    <compartment id='PlasmaMembrane' spatialDimensions='2' size='1e-14' constant='true'/>
    <compartment id='Cytosol' spatialDimensions='3' size='1e-15' constant='true'/>"
)
.unwrap();
assert!(compartments.iter() .any(|c| c.spatial_dimensions.unwrap() as i32 == 2));
assert!(compartments.iter()
    .any(|c| c.id == "Cytosol"));
assert!(compartments.iter()
    .all(|c| c.constant));

Fields

units: Option<UnitSIdRef>id: Stringname: Option<String>sbo_term: Option<String>spatial_dimensions: Option<f64>size: Option<f64>constant: bool

Trait Implementations

impl Clone for Compartment[src]

impl Debug for Compartment[src]

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

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

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

impl HasMethodsInventory for Compartment[src]

type Methods = Pyo3MethodsInventoryForCompartment

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

impl PartialEq<Compartment> for Compartment[src]

impl PyClass for Compartment[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 Compartment[src]

impl PyClassSend for Compartment[src]

type ThreadChecker = ThreadCheckerStub<Compartment>

impl PyProtoMethods for Compartment[src]

impl PyTypeInfo for Compartment[src]

type Type = Compartment

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 Compartment[src]

impl StructuralPartialEq for Compartment[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.