pub struct NativeSpectrumIDFormat {
pub term: NativeSpectrumIdentifierFormatTerm,
/* private fields */
}Expand description
A text-based schema that defines how native spectrum identifiers are formatted.
These patterns are often found in mzML-compatible formats.
Fields§
§term: NativeSpectrumIdentifierFormatTermImplementations§
Source§impl NativeSpectrumIDFormat
impl NativeSpectrumIDFormat
pub fn new(term: NativeSpectrumIdentifierFormatTerm) -> NativeSpectrumIDFormat
pub const fn name(&self) -> &str
pub const fn curie(&self) -> CURIE
Sourcepub fn parse<'h>(&self, ident: &'h str) -> Option<Captures<'h>>
pub fn parse<'h>(&self, ident: &'h str) -> Option<Captures<'h>>
This parses the provided string, returning the captured groups of the ID pattern if they are present
in a regex::Captures structure that can be indexed by group number.
Sourcepub fn parse_named<'h>(
&self,
ident: &'h str,
) -> Result<Vec<(Option<String>, &'h str)>, NativeIDFormatError>
pub fn parse_named<'h>( &self, ident: &'h str, ) -> Result<Vec<(Option<String>, &'h str)>, NativeIDFormatError>
This parses the provided string, returning the capture groups as (name, value) pairs they are present
Sourcepub fn format<'h>(
&self,
values: impl IntoIterator<Item = ValueRef<'h>>,
) -> Result<String, NativeIDFormatError>
pub fn format<'h>( &self, values: impl IntoIterator<Item = ValueRef<'h>>, ) -> Result<String, NativeIDFormatError>
Given the field values of a nativeID format, create string in that format
Trait Implementations§
Source§impl Clone for NativeSpectrumIDFormat
impl Clone for NativeSpectrumIDFormat
Source§fn clone(&self) -> NativeSpectrumIDFormat
fn clone(&self) -> NativeSpectrumIDFormat
Returns a duplicate 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 NativeSpectrumIDFormat
impl Debug for NativeSpectrumIDFormat
Source§impl From<NativeSpectrumIdentifierFormatTerm> for NativeSpectrumIDFormat
impl From<NativeSpectrumIdentifierFormatTerm> for NativeSpectrumIDFormat
Source§fn from(value: NativeSpectrumIdentifierFormatTerm) -> NativeSpectrumIDFormat
fn from(value: NativeSpectrumIdentifierFormatTerm) -> NativeSpectrumIDFormat
Converts to this type from the input type.
Source§impl PartialEq for NativeSpectrumIDFormat
impl PartialEq for NativeSpectrumIDFormat
Auto Trait Implementations§
impl Freeze for NativeSpectrumIDFormat
impl RefUnwindSafe for NativeSpectrumIDFormat
impl Send for NativeSpectrumIDFormat
impl Sync for NativeSpectrumIDFormat
impl Unpin for NativeSpectrumIDFormat
impl UnwindSafe for NativeSpectrumIDFormat
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