Enum nutlex::parser::DataRef

source ·
pub enum DataRef<V0, V1> {
    Real(V0),
    Complex(V1),
}
Expand description

Data saved by an Analysis.

Variants§

§

Real(V0)

A set of real signals.

§

Complex(V1)

A set of complex signals.

Implementations§

source§

impl<V0, V1> DataRef<V0, V1>

source

pub fn unwrap_real(self) -> V0

Returns the value contained in this variant.

§Panics

Panics if the enum value is not of the expected variant.

source

pub fn get_real(&self) -> Option<&V0>

Returns a reference to the value contained in this variant.

Returns None if the enum value is not of the expected variant.

source

pub fn into_real(self) -> Option<V0>

Returns the value contained in this variant.

Returns None if the enum value is not of the expected variant.

source

pub fn unwrap_complex(self) -> V1

Returns the value contained in this variant.

§Panics

Panics if the enum value is not of the expected variant.

source

pub fn get_complex(&self) -> Option<&V1>

Returns a reference to the value contained in this variant.

Returns None if the enum value is not of the expected variant.

source

pub fn into_complex(self) -> Option<V1>

Returns the value contained in this variant.

Returns None if the enum value is not of the expected variant.

source

pub fn is_real(&self) -> bool

Returns true if this value is the expected variant.

source

pub fn is_complex(&self) -> bool

Returns true if this value is the expected variant.

source

pub fn as_ref(&self) -> DataRef<&V0, &V1>

Converts generic types to references.

For example, transforms the type parameter T to &T.

source

pub fn as_mut(&mut self) -> DataRef<&mut V0, &mut V1>

Converts generic types to mutable references.

For example, transforms the type parameter T to &mut T.

Auto Trait Implementations§

§

impl<V0, V1> RefUnwindSafe for DataRef<V0, V1>

§

impl<V0, V1> Send for DataRef<V0, V1>
where V0: Send, V1: Send,

§

impl<V0, V1> Sync for DataRef<V0, V1>
where V0: Sync, V1: Sync,

§

impl<V0, V1> Unpin for DataRef<V0, V1>
where V0: Unpin, V1: Unpin,

§

impl<V0, V1> UnwindSafe for DataRef<V0, V1>
where V0: UnwindSafe, V1: UnwindSafe,

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>,

§

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>,

§

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.