Skip to main content

MultiLayerSpectrum

Struct MultiLayerSpectrum 

Source
pub struct MultiLayerSpectrum<C = CentroidPeak, D = DeconvolutedPeak>{
    pub description: SpectrumDescription,
    pub arrays: Option<BinaryArrayMap>,
    pub peaks: Option<PeakSetVec<C, MZ>>,
    pub deconvoluted_peaks: Option<PeakSetVec<D, Mass>>,
}
Expand description

Represent a spectrum with multiple layers of representation of the peak data.

This type is useful because it permits us to hold spectra in incrementally more processed representations without loss of information.

Fields§

§description: SpectrumDescription

The spectrum metadata describing acquisition conditions and details.

§arrays: Option<BinaryArrayMap>

The (potentially absent) data arrays describing the m/z, intensity, and potentially other measured properties

§peaks: Option<PeakSetVec<C, MZ>>§deconvoluted_peaks: Option<PeakSetVec<D, Mass>>

Implementations§

Source§

impl<C, D> MultiLayerSpectrum<C, D>

Source

pub fn new( description: SpectrumDescription, arrays: Option<BinaryArrayMap>, peaks: Option<PeakSetVec<C, MZ>>, deconvoluted_peaks: Option<PeakSetVec<D, Mass>>, ) -> MultiLayerSpectrum<C, D>

Create a new MultiLayerSpectrum from a SpectrumDescription and any/all/none of the different levels of processing details for signal data.

Source§

impl<C, D> MultiLayerSpectrum<C, D>

Source

pub fn into_centroid( self, ) -> Result<CentroidSpectrumType<C>, SpectrumConversionError>

Convert a spectrum into a CentroidSpectrumType.

This will try the following steps to get the peak list to use in the new instance:

  1. If the peaks field is populated, use it directly .
  2. If the Self::signal_continuity is SignalContinuity::Centroid and Self::arrays is populated, attempt [C::try_from_arrays] to build the peak list from the raw arrays. Otherwise assume the peak list is empty.
  3. Fail with SpectrumConversionError::NotCentroided
Examples found in repository?
examples/readme.rs (line 23)
6fn main() -> io::Result<()> {
7    let reader = mzdata::MZReader::open_path("./test/data/small.mzML")?;
8
9    let mut ms1_count = 0;
10    let mut msn_count = 0;
11    for spectrum in reader {
12        if spectrum.ms_level() == 1 {
13            ms1_count += 1;
14        } else {
15            msn_count += 1;
16        }
17        println!(
18            "Scan {} => BP {}",
19            spectrum.id(),
20            spectrum.peaks().base_peak().mz
21        );
22        if spectrum.signal_continuity() < SignalContinuity::Profile {
23            let peak_picked = spectrum.into_centroid().unwrap();
24            println!(
25                "Matches for 579.155: {:?}",
26                peak_picked
27                    .peaks
28                    .all_peaks_for(579.155, Tolerance::Da(0.02))
29            );
30        }
31    }
32    println!("MS1 Count: {}\nMSn Count: {}", ms1_count, msn_count);
33    assert_eq!(ms1_count, 14);
34    assert_eq!(msn_count, 34);
35    Ok(())
36}
Source

pub fn into_raw(self) -> Result<RawSpectrum, SpectrumConversionError>

Convert a spectrum into a RawSpectrum

Source

pub fn from_arrays_and_description( arrays: BinaryArrayMap, description: SpectrumDescription, ) -> MultiLayerSpectrum<C, D>

Construct a MultiLayerSpectrum with description and the provided raw data arrays

Source

pub fn from_description( description: SpectrumDescription, ) -> MultiLayerSpectrum<C, D>

Construct a MultiLayerSpectrum with description and no peak data of any kind

Source

pub fn from_peaks_data_levels_and_description( peaks: PeakDataLevel<C, D>, description: SpectrumDescription, ) -> MultiLayerSpectrum<C, D>

Construct a MultiLayerSpectrum with description and a PeakDataLevel containing at most one of the data modalities. This is convenient for reconstructing a spectrum from its parts.

Source

pub fn from_spectrum_like<S>(spectrum: S) -> MultiLayerSpectrum<C, D>
where S: SpectrumLike<C, D>,

Converts an arbitrary SpectrumLike type into a MultiLayerSpectrum with the same peak types.

This is a thin wrapper around SpectrumLike::into_peaks_and_description and MultiLayerSpectrum::from_peaks_data_levels_and_description

Source

pub fn reinterpret<C1, D1>(self) -> MultiLayerSpectrum<C1, D1>

Convert a MultiLayerSpectrum with one set of peak types to another with any peak type, but recode the peak list as DataArray as an intermediary, potentially losing information if the new peak types do not re-use the same ArrayType during peak reconstruction.

§Note

Peak data is not actually reconstructed from the intermediate data arrays. If that is desired, call MultiLayerSpectrum::try_build_peaks

Source

pub fn denoise(&mut self, scale: f32) -> Result<(), SpectrumProcessingError>

Apply a local denoising algorithm to the signal that is suitable for profile mode data using mzsignal::denoise.

Source

pub fn reprofile_with_shape( &mut self, dx: f64, fwhm: f32, ) -> Result<(), SpectrumProcessingError>

When mzsignal is available, use mzsignal::reprofile::PeakSetReprofiler to create new profile m/z and intensity DataArrays from MultiLayerSpectrum::peaks, updating MultiLayerSpectrum::arrays.

NOTE: This does not modify SpectrumLike::signal_continuity, and if it is desired you should update this manually to SignalContinuity::Profile.

§Arguments
  • dx: The m/z grid spacing that the profile signal will be projected onto. The best value to use here depends upon the spectrum’s resolution, but when resources are not an issue between 0.005 and 0.001 are is a choice. This may produce a lot of wasted space however.
  • fwhm: The uniform peak full-width-at-half-max to assume for all peaks. It controls the broadness of the theoretical gaussian profile created around each centroid peak. If non-uniform shapes are needed, directly use PeakSetReprofiler.
Source§

impl<C, D> MultiLayerSpectrum<C, D>

Source

pub fn try_build_peaks( &mut self, ) -> Result<RefPeakDataLevel<'_, C, D>, SpectrumConversionError>

Attempt to reconstruct one of the peak layers based upon the available data arrays if this spectrum is in centroid mode.

§Errors

If constructing the peak list encounters an error, or if data array access/decoding fails, a SpectrumConversionError is returned.

Source

pub fn try_build_centroids( &mut self, ) -> Result<&PeakSetVec<C, MZ>, SpectrumConversionError>

Source

pub fn try_build_deconvoluted_centroids( &mut self, ) -> Result<&PeakSetVec<D, Mass>, SpectrumConversionError>

Source§

impl<C, D> MultiLayerSpectrum<C, D>

When mzsignal is available, MultiLayerSpectrum supports in-place signal processing operations.

The peak picking steps need to convert an mzsignal::FittedPeak into C. This is trivial for CentroidPeak and mzsignal::FittedPeak itself.

Source

pub fn pick_peaks_with( &mut self, peak_picker: &PeakPicker, ) -> Result<(), SpectrumProcessingError>

Using a pre-configured mzsignal::PeakPicker to pick peaks from arrays’s signal, populating the peaks field.

If SpectrumLike::signal_continuity returns SignalContinuity::Centroid, then no filtering is performed and all points are directly converted into picked peaks.

NOTE: This does not modify SpectrumLike::signal_continuity, and if it is desired you should update this manually to SignalContinuity::Centroid.

Source

pub fn pick_peaks( &mut self, signal_to_noise_threshold: f32, ) -> Result<(), SpectrumProcessingError>

Pick peaks with a minimum signal-to-noise threshold, populating MultiLayerSpectrum::peaks with an mzpeaks::MZPeakSetType over C.

§See also

MultiLayerSpectrum::pick_peaks_with

Source

pub fn pick_peaks_in_intervals( &mut self, signal_to_noise_threshold: f32, intervals: &[(f64, f64)], ) -> Result<(), SpectrumProcessingError>

Pick peaks in the specified m/z intervals with a minimum signal-to-noise threshold, populating MultiLayerSpectrum::peaks with an mzpeaks::MZPeakSetType over C from those intervals.

If SpectrumLike::signal_continuity returns SignalContinuity::Centroid, then array data is converted to peaks as in MultiLayerSpectrum::pick_peaks and then only those peaks in the requested intervals are kept.

NOTE: This does not modify SpectrumLike::signal_continuity, and if it is desired you should update this manually to SignalContinuity::Centroid.

Trait Implementations§

Source§

impl<C, D> Clone for MultiLayerSpectrum<C, D>

Source§

fn clone(&self) -> MultiLayerSpectrum<C, D>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C, D> Debug for MultiLayerSpectrum<C, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<C, D> Default for MultiLayerSpectrum<C, D>

Source§

fn default() -> MultiLayerSpectrum<C, D>

Returns the “default value” for a type. Read more
Source§

impl<'de, C, D> Deserialize<'de> for MultiLayerSpectrum<C, D>

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<MultiLayerSpectrum<C, D>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<C, D> From<CentroidSpectrumType<C>> for MultiLayerSpectrum<C, D>

Source§

fn from(spectrum: CentroidSpectrumType<C>) -> MultiLayerSpectrum<C, D>

Converts to this type from the input type.
Source§

impl<C, D> From<MultiLayerSpectrum<C, D>> for RawSpectrum

Source§

fn from(spectrum: MultiLayerSpectrum<C, D>) -> RawSpectrum

Converts to this type from the input type.
Source§

impl<C: CentroidLike + BuildFromArrayMap + BuildArrayMapFrom, D: DeconvolutedCentroidLike + BuildFromArrayMap + BuildArrayMapFrom> From<PROXISpectrum> for MultiLayerSpectrum<C, D>

Source§

fn from(value: PROXISpectrum) -> Self

Converts to this type from the input type.
Source§

impl<C, D> From<RawSpectrum> for MultiLayerSpectrum<C, D>

Source§

fn from(spectrum: RawSpectrum) -> MultiLayerSpectrum<C, D>

Converts to this type from the input type.
Source§

impl<C, D> ParamDescribed for MultiLayerSpectrum<C, D>

Source§

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

Obtain an immutable slice over the encapsulated Param list
Source§

fn params_mut(&mut self) -> &mut Vec<Param>

Obtain an mutable slice over the encapsulated Param list
Source§

fn add_param(&mut self, param: Param)

Add a new Param to the entity
Source§

fn extend_params(&mut self, it: impl IntoIterator<Item = Param>)

Add all parameters from an iterator of 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 Read more
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
Source§

impl<C: CentroidLike + BuildArrayMapFrom + BuildFromArrayMap, D: DeconvolutedCentroidLike + BuildArrayMapFrom + BuildFromArrayMap, G: SpectrumGrouping<C, D, MultiLayerSpectrum<C, D>>, R: RandomAccessSpectrumGroupingIterator<C, D, MultiLayerSpectrum<C, D>, G>> RandomAccessSpectrumGroupingIterator<C, D, MultiLayerSpectrum<C, D>, G> for SpectrumAveragingIterator<'_, C, D, G, R>

Source§

fn reset_state(&mut self)

Source§

fn start_from_id(&mut self, id: &str) -> Result<&Self, SpectrumAccessError>

Source§

fn start_from_index( &mut self, index: usize, ) -> Result<&Self, SpectrumAccessError>

Source§

fn start_from_time(&mut self, time: f64) -> Result<&Self, SpectrumAccessError>

Source§

impl<C, D> Serialize for MultiLayerSpectrum<C, D>

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'a, C: CentroidLike + BuildFromArrayMap, D: DeconvolutedCentroidLike + BuildFromArrayMap> SpectrumBuilding<'a, C, D, MultiLayerSpectrum<C, D>> for ImzMLSpectrumBuilder<'a, C, D>

Source§

fn into_spectrum(self, spectrum: &mut MultiLayerSpectrum<C, D>)

Move all the data into the provided spectrum reference
Source§

fn into_chromatogram(self, chromatogram: &mut Chromatogram)

Move all the data into the provided chromatogram reference
Source§

fn set_run_data_processing(&mut self, run_data_processing: Option<Box<str>>)

Optionally set the global data processing identifier for the run to be used if a data processing reference isn’t specified locally. Read more
Source§

fn borrow_metadata( self, instrument_id_map: &'a mut IncrementingIdMap, reference_param_groups: &'a HashMap<String, Vec<Param>>, ) -> Self

Source§

fn fill_spectrum<P: ParamLike + Into<Param> + ParamValue>(&mut self, param: P)

Put a parameter-like instance into the current top-level instance
Source§

fn current_array_mut(&mut self) -> &mut DataArray

Get the current DataArray being built. This may be an empty instance if if there is no array being built currently.
Source§

fn precursor_mut(&mut self) -> &mut Precursor

Get the current Precursor being built.
Source§

fn new_precursor_mut(&mut self) -> &mut Precursor

Add a new Precursor to the stack. This will be the current Precursor.
Source§

fn new_selected_ion(&mut self) -> &mut SelectedIon

Add a new SelectedIon to the stack for the current Precursor. This will be the current SelectedIon.
Source§

fn selected_ion_mut(&mut self) -> &mut SelectedIon

Get the current SelectedIon being built.
Source§

fn scan_window_mut(&mut self) -> &mut ScanWindow

Get the last scan window being constructed.
Source§

fn isolation_window_mut(&mut self) -> &mut IsolationWindow

Get the last isolation window being constructed
Source§

fn product_isolation_window_mut(&mut self) -> &mut IsolationWindow

Source§

fn new_product(&mut self) -> &mut Product

Source§

fn set_current_compression(&mut self, compression: BinaryCompressionType)

Set the compression method for the current DataArray
Source§

fn fill_binary_data_array<P: ParamLike + Into<Param> + ParamValue>( &mut self, param: P, )

Put a parameter-like instance into the current DataArray
Source§

fn fill_selected_ion(&mut self, param: Param)

Put a parameter-like instance into the current SelectedIon
Source§

fn populate_isolation_window(param: Param, window: &mut IsolationWindow)

Source§

fn fill_isolation_window(&mut self, param: Param)

Put a parameter-like instance into the current IsolationWindow
Source§

fn fill_product_isolation_window(&mut self, param: Param)

Put a parameter-like instance into the current IsolationWindow from a Product
Source§

fn fill_scan_window(&mut self, param: Param)

Put a parameter-like instance into the current ScanWindow
Source§

impl<C, D> SpectrumLike<C, D> for MultiLayerSpectrum<C, D>

Source§

fn description(&self) -> &SpectrumDescription

The method to access the spectrum description itself, which supplies the data for most other methods on this trait.
Source§

fn description_mut(&mut self) -> &mut SpectrumDescription

The method to access the spectrum descript itself, mutably.
Source§

fn peaks(&self) -> RefPeakDataLevel<'_, C, D>

Retrieve the most processed representation of the mass spectrum’s signal
Source§

fn raw_arrays(&self) -> Option<&BinaryArrayMap>

Obtain a reference to the BinaryArrayMap if one is available for the peak information. This may not be the most refined version of the peak signal if it has been processed further.
Source§

fn into_peaks_and_description( self, ) -> (PeakDataLevel<C, D>, SpectrumDescription)

Consume the spectrum, decomposing it into the SpectrumDescription and an owning PeakDataLevel. Read more
Source§

fn acquisition(&self) -> &Acquisition

Access the acquisition information for this spectrum.
Source§

fn precursor(&self) -> Option<&Precursor>

Access the (first) precursor information, if it exists.
Source§

fn precursor_iter(&self) -> impl Iterator<Item = &Precursor> + ExactSizeIterator

Iterate over all precursors of the spectrum
Source§

fn precursor_count(&self) -> usize

The number of precursor levels recorded
Source§

fn precursor_mut(&mut self) -> Option<&mut Precursor>

Mutably access the (first) precursor information, if it exists
Source§

fn precursor_iter_mut( &mut self, ) -> impl Iterator<Item = &mut Precursor> + ExactSizeIterator

Iterate over all precursors of the spectrum mutably
Source§

fn add_precursor(&mut self, precursor: Precursor)

Add a precursor to the list of precursors for this spectrum. Read more
Source§

fn remove_precursor(&mut self, index: usize) -> Precursor

Remove the precursor entry at index in the precursor list. Read more
Source§

fn start_time(&self) -> f64

A shortcut method to retrieve the scan start time of a spectrum
Source§

fn ms_level(&self) -> u8

Access the MS exponentiation level
Source§

fn id(&self) -> &str

Access the native ID string for the spectrum
Source§

fn index(&self) -> usize

Access the index of the spectrum in the source file
Source§

fn signal_continuity(&self) -> SignalContinuity

Access a description of how raw the signal is, whether a profile spectrum is available or only centroids are present.
Source§

fn polarity(&self) -> ScanPolarity

Access a description of the spectrum polarity
Source§

fn ion_mobility(&self) -> Option<f64>

Access the point measure of ion mobility associated with the scan if present. This is distinct from having a frame-level scan across the ion mobility dimension.
Source§

fn has_ion_mobility(&self) -> bool

Check if this spectrum has a point measure of ion mobility. This is distinct from having a frame-level scan across the ion mobility dimension.
Source§

fn has_ion_mobility_dimension(&self) -> bool

Check if this spectrum has an ion mobility dimension/array. This is distinct from having a scan-level point measure of ion mobility.
Source§

fn has_ion_mobility_class(&self) -> HasIonMobility

A single point of entry for checking if ion mobility is present.
Source§

fn spectrum_type(&self) -> Option<SpectrumType>

Find the type of spectrum described. Read more
Source§

fn set_spectrum_type(&mut self, spectrum_type: SpectrumType)

Set the kind of spectrum represented.
Source§

fn update_summaries(&mut self)

Compute and update the the total ion current, base peak, and m/z range for the spectrum based upon its current peak data. Read more
Source§

impl<CFeat, DFeat, CPeak, DPeak> TryFrom<MultiLayerIonMobilityFrame<CFeat, DFeat>> for MultiLayerSpectrum<CPeak, DPeak>

A MultiLayerIonMobilityFrame can be converted to MultiLayerSpectrum by flattening the feature data into a BinaryArrayMap.

Source§

type Error = ArrayRetrievalError

The type returned in the event of a conversion error.
Source§

fn try_from( value: MultiLayerIonMobilityFrame<CFeat, DFeat>, ) -> Result<MultiLayerSpectrum<CPeak, DPeak>, <MultiLayerSpectrum<CPeak, DPeak> as TryFrom<MultiLayerIonMobilityFrame<CFeat, DFeat>>>::Error>

Performs the conversion.
Source§

impl<C, D> TryFrom<MultiLayerSpectrum<C, D>> for CentroidSpectrumType<C>

Source§

type Error = SpectrumConversionError

The type returned in the event of a conversion error.
Source§

fn try_from( spectrum: MultiLayerSpectrum<C, D>, ) -> Result<CentroidSpectrumType<C>, <CentroidSpectrumType<C> as TryFrom<MultiLayerSpectrum<C, D>>>::Error>

Performs the conversion.
Source§

impl<C, D> TryFrom<MultiLayerSpectrum<C, D>> for DeconvolutedSpectrumType<D>

Source§

type Error = SpectrumConversionError

The type returned in the event of a conversion error.
Source§

fn try_from( value: MultiLayerSpectrum<C, D>, ) -> Result<DeconvolutedSpectrumType<D>, <DeconvolutedSpectrumType<D> as TryFrom<MultiLayerSpectrum<C, D>>>::Error>

Performs the conversion.
Source§

impl<CFeat, DFeat, CPeak, DPeak> TryFrom<MultiLayerSpectrum<CPeak, DPeak>> for MultiLayerIonMobilityFrame<CFeat, DFeat>

§Errors

This will fail if BinaryArrayMap3D::stack fails

Source§

type Error = ArrayRetrievalError

The type returned in the event of a conversion error.
Source§

fn try_from( value: MultiLayerSpectrum<CPeak, DPeak>, ) -> Result<MultiLayerIonMobilityFrame<CFeat, DFeat>, <MultiLayerIonMobilityFrame<CFeat, DFeat> as TryFrom<MultiLayerSpectrum<CPeak, DPeak>>>::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more