Skip to main content

ValueFormat

Enum ValueFormat 

Source
pub enum ValueFormat<T: Element + ?Sized> {
    Scalar(Scalar<T>),
    Spectrum(Spectrum<T>),
    Image(Image<T>),
}
Expand description

A data in any of the formats Tango has, as many dimensions as it has.

Variants§

§

Scalar(Scalar<T>)

§

Spectrum(Spectrum<T>)

§

Image(Image<T>)

Implementations§

Source§

impl<T: Element + ?Sized> ValueFormat<T>

Source

pub fn scalar(&self) -> Option<&Scalar<T>>

The data, if it is a scalar.

Source

pub fn into_scalar(self) -> Result<Scalar<T>, Self>

The data, if it is a scalar, or this format back.

Source

pub fn spectrum(&self) -> Option<&Spectrum<T>>

The data, if it is a spectrum.

Source

pub fn into_spectrum(self) -> Result<Spectrum<T>, Self>

The data, if it is a spectrum, or this format back.

Source

pub fn image(&self) -> Option<&Image<T>>

The data, if it is a image.

Source

pub fn into_image(self) -> Result<Image<T>, Self>

The data, if it is a image, or this format back.

Trait Implementations§

Source§

impl<T: Element + ?Sized> Clone for ValueFormat<T>

Source§

fn clone(&self) -> Self

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<T: Element + ?Sized> Debug for ValueFormat<T>

Source§

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

The data it holds, whose dimensions already tell its format.

Source§

impl<T: Element + ?Sized> PartialEq for ValueFormat<T>
where for<'a> T::Ref<'a>: PartialEq,

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl<T> Forget for ValueFormat<T>
where T: ?Sized,

§

impl<T> Freeze for ValueFormat<T>
where Buf<T, 0>: Freeze, Buf<T, 1>: Freeze, Buf<T, 2>: Freeze, T: ?Sized,

§

impl<T> RefUnwindSafe for ValueFormat<T>
where Buf<T, 0>: RefUnwindSafe, Buf<T, 1>: RefUnwindSafe, Buf<T, 2>: RefUnwindSafe, T: ?Sized,

§

impl<T> Send for ValueFormat<T>
where Buf<T, 0>: Send, Buf<T, 1>: Send, Buf<T, 2>: Send, T: ?Sized,

§

impl<T> Sync for ValueFormat<T>
where Buf<T, 0>: Sync, Buf<T, 1>: Sync, Buf<T, 2>: Sync, T: ?Sized,

§

impl<T> Unpin for ValueFormat<T>
where Buf<T, 0>: Unpin, Buf<T, 1>: Unpin, Buf<T, 2>: Unpin, T: ?Sized,

§

impl<T> UnsafeUnpin for ValueFormat<T>
where Buf<T, 0>: UnsafeUnpin, Buf<T, 1>: UnsafeUnpin, Buf<T, 2>: UnsafeUnpin, T: ?Sized,

§

impl<T> UnwindSafe for ValueFormat<T>
where Buf<T, 0>: UnwindSafe, Buf<T, 1>: UnwindSafe, Buf<T, 2>: UnwindSafe, T: ?Sized,

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> 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> 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> Model for T
where T: Send + Sync + 'static,

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