Trait mzdata::params::ParamDescribed

source ·
pub trait ParamDescribed {
    // Required methods
    fn params(&self) -> &[Param];
    fn params_mut(&mut self) -> &mut ParamList;

    // Provided methods
    fn add_param(&mut self, param: Param) { ... }
    fn remove_param(&mut self, index: usize) -> Param { ... }
    fn get_param_by_name(&self, name: &str) -> Option<&Param> { ... }
    fn get_param_by_curie(&self, curie: &CURIE) -> Option<&Param> { ... }
    fn get_param_by_accession(&self, accession: &str) -> Option<&Param> { ... }
    fn iter_params(&self) -> Iter<'_, Param> { ... }
    fn iter_params_mut(&mut self) -> IterMut<'_, Param> { ... }
}

Required Methods§

source

fn params(&self) -> &[Param]

Obtain an immutable slice over the encapsulated Param list

source

fn params_mut(&mut self) -> &mut ParamList

Obtain an mutable slice over the encapsulated Param list

Provided Methods§

source

fn add_param(&mut self, param: Param)

Add a new Param to the entity

source

fn remove_param(&mut self, index: usize) -> Param

Remove the ith Param from the entity.

source

fn get_param_by_name(&self, name: &str) -> Option<&Param>

Find the first Param whose name matches name

source

fn get_param_by_curie(&self, curie: &CURIE) -> Option<&Param>

Find the first Param whose CURIE matches curie

source

fn get_param_by_accession(&self, accession: &str) -> Option<&Param>

Find the first Param whose Param::accession matches accession

This is equivalent to ParamDescribed::get_param_by_curie on accession.parse::<CURIE>().unwrap()

source

fn iter_params(&self) -> Iter<'_, Param>

Iterate over the encapsulated parameter list

source

fn iter_params_mut(&mut self) -> IterMut<'_, Param>

Iterate mutably over the encapsulated parameter list

Implementors§