Enum Source

Source
pub enum Source<C = CentroidPeak, D = DeconvolutedPeak>{
    PathLike(PathBuf),
    Receiver(SpectrumReceiver<C, D, MultiLayerSpectrum<C, D>>),
    Stdin,
    Reader(Box<dyn SeekRead + Send>, Option<MassSpectrometryFormat>),
}
Expand description

An abstraction over different ways to get a SpectrumSource from a file path, buffer, or pipe.

Variants§

§

PathLike(PathBuf)

A concrete path on the file system

§

Receiver(SpectrumReceiver<C, D, MultiLayerSpectrum<C, D>>)

An in-memory channel of existing spectra

§

Stdin

Read from Stdin

§

Reader(Box<dyn SeekRead + Send>, Option<MassSpectrometryFormat>)

A thing implementing std::io::Read and std::io::Seek, along with an expected format

Implementations§

Trait Implementations§

Source§

impl<C, D> From<&Path> for Source<C, D>

Source§

fn from(value: &Path) -> Source<C, D>

Converts to this type from the input type.
Source§

impl<C, D> From<(Box<dyn SeekRead + Send>, MassSpectrometryFormat)> for Source<C, D>

Source§

fn from( value: (Box<dyn SeekRead + Send>, MassSpectrometryFormat), ) -> Source<C, D>

Converts to this type from the input type.
Source§

impl<C, D> From<Box<dyn SeekRead + Send>> for Source<C, D>

Source§

fn from(value: Box<dyn SeekRead + Send>) -> Source<C, D>

Converts to this type from the input type.
Source§

impl<C, D> From<Receiver<MultiLayerSpectrum<C, D>>> for Source<C, D>

Source§

fn from(value: Receiver<MultiLayerSpectrum<C, D>>) -> Source<C, D>

Converts to this type from the input type.
Source§

impl<C, D> From<SpectrumReceiver<C, D, MultiLayerSpectrum<C, D>>> for Source<C, D>

Source§

fn from(value: SpectrumReceiver<C, D, MultiLayerSpectrum<C, D>>) -> Source<C, D>

Converts to this type from the input type.
Source§

impl<C, D> From<String> for Source<C, D>

Source§

fn from(value: String) -> Source<C, D>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<C, D> Freeze for Source<C, D>

§

impl<C = CentroidPeak, D = DeconvolutedPeak> !RefUnwindSafe for Source<C, D>

§

impl<C, D> Send for Source<C, D>

§

impl<C = CentroidPeak, D = DeconvolutedPeak> !Sync for Source<C, D>

§

impl<C, D> Unpin for Source<C, D>
where C: Unpin, D: Unpin,

§

impl<C = CentroidPeak, D = DeconvolutedPeak> !UnwindSafe for Source<C, D>

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.