[−][src]Struct rust_sbml::Model
Abstraction over the SBML specification. It traverses each top-level
listOF_ and provides HashMaps<id, object>
instead. In addition the model
units are gathered in an ModelUnits
struct.
Example
use rust_sbml::Model; use std::fs; let ecoli = fs::read_to_string("examples/EcoliCore.xml").unwrap(); let document = Model::parse(&ecoli).unwrap(); println!("{:?}", document.objectives); assert_eq!( document .objectives .unwrap() .iter() .map(|reac_id| reac_id.to_owned()) .next(), Some("R_BIOMASS_Ecoli_core_w_GAM".to_string()) );
Fields
id: Option<String>
metaid: Option<String>
name: Option<String>
model_units: ModelUnits
initial_assignments: HashMap<String, InitialAssignment>
parameters: HashMap<String, Parameter>
species: HashMap<String, Species>
reactions: HashMap<String, Reaction>
compartments: HashMap<String, Compartment>
unit_definitions: HashMap<String, HashMap<UnitSIdRef, Unit>>
constraints: Vec<Constraint>
objectives: Option<Vec<String>>
Implementations
impl Model
[src]
pub fn get_list_of_compartments(&self) -> Vec<&Compartment>
[src]
pub fn get_list_of_species(&self) -> Vec<&Species>
[src]
Emulating the API of libSBML
Example
use rust_sbml::Model; use std::fs; let ecoli = fs::read_to_string("examples/EcoliCore.xml").unwrap(); let document = Model::parse(&ecoli).unwrap(); println!("{:?}", document.get_list_of_compartments())
pub fn get_list_of_reactions(&self) -> Vec<&Reaction>
[src]
Emulating the API of libSBML
Example
use rust_sbml::Model; use std::fs; let ecoli = fs::read_to_string("examples/EcoliCore.xml").unwrap(); let document = Model::parse(&ecoli).unwrap(); println!("{:?}", document.get_list_of_species())
pub fn parse(doc: &str) -> Result<Self, Box<dyn Error>>
[src]
Emulating the API of libSBML
Example
use rust_sbml::Model; use std::fs; let ecoli = fs::read_to_string("examples/EcoliCore.xml").unwrap(); let document = Model::parse(&ecoli).unwrap(); println!("{:?}", document.get_list_of_reactions())
Trait Implementations
impl Debug for Model
[src]
impl Default for Model
[src]
impl<'a> ExtractExt<'a> for &'a Model
[src]
impl<'a> ExtractExt<'a> for &'a mut Model
[src]
impl HasMethodsInventory for Model
[src]
type Methods = Pyo3MethodsInventoryForModel
impl HasProtoRegistry for Model
[src]
impl IntoPy<Py<PyAny>> for Model
[src]
impl PartialEq<Model> for Model
[src]
impl PyClass for Model
[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 Model
[src]
unsafe fn new(py: Python<'_>, subtype: *mut PyTypeObject) -> *mut Self::Layout
[src]
unsafe fn dealloc(py: Python<'_>, self_: *mut Self::Layout)
[src]
impl PyClassSend for Model
[src]
type ThreadChecker = ThreadCheckerStub<Model>
impl PyTypeInfo for Model
[src]
type Type = Model
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
const NAME: &'static str
[src]
const MODULE: Option<&'static str>
[src]
const DESCRIPTION: &'static str
[src]
const FLAGS: usize
[src]
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
[src]
fn is_instance(object: &PyAny) -> bool
[src]
fn is_exact_instance(object: &PyAny) -> bool
[src]
impl StructuralPartialEq for Model
[src]
Auto Trait Implementations
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> PyClassAlloc for T where
T: PyTypeInfo + PyClassWithFreeList,
[src]
T: PyTypeInfo + PyClassWithFreeList,
pub unsafe fn new(
py: Python<'_>,
subtype: *mut PyTypeObject
) -> *mut <T as PyTypeInfo>::Layout
[src]
py: Python<'_>,
subtype: *mut PyTypeObject
) -> *mut <T as PyTypeInfo>::Layout
pub unsafe fn dealloc(py: Python<'_>, self_: *mut <T as PyTypeInfo>::Layout)
[src]
impl<T> PyErrArguments for T where
T: IntoPy<Py<PyAny>> + Send + Sync,
[src]
T: IntoPy<Py<PyAny>> + Send + Sync,
impl<T> PyProtoMethods for T where
T: HasProtoRegistry,
[src]
T: HasProtoRegistry,
pub fn async_methods() -> Option<NonNull<PyAsyncMethods>>
[src]
pub fn basic_methods() -> Option<NonNull<PyObjectMethods>>
[src]
pub fn buffer_methods() -> Option<NonNull<PyBufferProcs>>
[src]
pub fn descr_methods() -> Option<NonNull<PyDescrMethods>>
[src]
pub fn gc_methods() -> Option<NonNull<PyGCMethods>>
[src]
pub fn mapping_methods() -> Option<NonNull<PyMappingMethods>>
[src]
pub fn number_methods() -> Option<NonNull<PyNumberMethods>>
[src]
pub fn iter_methods() -> Option<NonNull<PyIterMethods>>
[src]
pub fn sequence_methods() -> Option<NonNull<PySequenceMethods>>
[src]
impl<T> PyTypeObject for T where
T: PyTypeInfo,
[src]
T: PyTypeInfo,
pub fn type_object(py: Python<'_>) -> &PyType
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,