pub struct IsolationWindowBuilder<'a>(pub &'a mut IsolationWindow);Expand description
A helper type that wraps an existing mutable reference to IsolationWindow
that runs through a state machine updating fields depending upon the accumulated
state of the isolation window.
If relative offsets are used, they will materialize +/- relative to Self::target.
If the deprecated absolute limits are used, they are taken as-is. The relative and
absolute APIs should not be mixed as the state machine does not track absolute/relative
bounds independently.
use mzdata_spectrum::{IsolationWindow, IsolationWindowBuilder};
let mut state = IsolationWindow::default();
IsolationWindowBuilder(&mut state)
.lower_offset(2.0)
.upper_offset(3.0)
.target(500.0);
assert_eq!(state.lower_bound, 498.0);
assert_eq!(state.upper_bound, 503.0);
assert_eq!(state.target, 500.0);Tuple Fields§
§0: &'a mut IsolationWindowImplementations§
Source§impl<'a> IsolationWindowBuilder<'a>
impl<'a> IsolationWindowBuilder<'a>
Sourcepub const fn flags(&self) -> IsolationWindowState
pub const fn flags(&self) -> IsolationWindowState
Get the current state of the isolation window
Sourcepub const fn lower_offset(self, lower_bound: f32) -> Self
pub const fn lower_offset(self, lower_bound: f32) -> Self
Set the lower offset relative to the Self::target
§Panics
If one of the bounds is already explicit and the target is not specified
Sourcepub const fn upper_offset(self, upper_bound: f32) -> Self
pub const fn upper_offset(self, upper_bound: f32) -> Self
Set the upper offset relative to the Self::target
§Panics
If one of the bounds is already explicit and the target is not specified
Sourcepub const fn lower_limit(self, lower_bound: f32) -> Self
pub const fn lower_limit(self, lower_bound: f32) -> Self
Set the explicit lower limit
Sourcepub const fn upper_limit(self, upper_bound: f32) -> Self
pub const fn upper_limit(self, upper_bound: f32) -> Self
Set the explicit upper limit
Sourcepub const fn no_isolation(self) -> Self
pub const fn no_isolation(self) -> Self
Set no isolation, MSe/all ions fragmentation
Sourcepub const fn is_complete(&self) -> bool
pub const fn is_complete(&self) -> bool
Check if the window is finished being configured