[][src]Enum arnalisa::Item

pub enum Item {
    Nothing,
    B(bool),
    I8(i8),
    I16(i16),
    I32(i32),
    I64(i64),
    U8(u8),
    U16(u16),
    U32(u32),
    U64(u64),
    F32(R32),
    F64(R64),
}

An item which gets passed on between bins through pipes.

Variants

Nothing

No value (akin to Null or None in programming languages).

B(bool)

A boolean value.

I8(i8)

A signed 8-bit integer value.

I16(i16)

A signed 16-bit integer value.

I32(i32)

A signed 32-bit integer value.

I64(i64)

A signed 64-bit integer value.

U8(u8)

An unsigned 8-bit integer value.

U16(u16)

An unsigned 16-bit integer value.

U32(u32)

An unsigned 32-bit integer value.

U64(u64)

An unsigned 64-bit integer value.

F32(R32)

A 32-bit floating point value.

F64(R64)

A 64-bit floating point value.

Methods

impl Item[src]

pub fn is_bool(&self) -> bool[src]

Check whether the item is a Item::B(_).

pub fn is_numeric(&self) -> bool[src]

Check whether the item is one of the integer or float variants.

pub fn is_float(&self) -> bool[src]

Check whether the item is a Item::F32(_) or a Item::F64(_).

pub fn can_convert_to_f64(&self) -> bool[src]

Check whether the item can be converted to f64.

pub fn to_u64(&self) -> Result<u64>[src]

Convert the item to a u64.

  • A Item::B(_) becomes 0u64 if false, 1u64 if true.
  • Any numeric item gets casted to a u64.
  • Item::Nothing returns an error.

pub fn to_usize(&self) -> Result<usize>[src]

Convert the item to a usize.

  • A Item::B(_) becomes 0usize if false, 1usize if true.
  • Any numeric item gets casted to a usize.
  • Item::Nothing returns an error.

pub fn to_bool(&self) -> Result<bool>[src]

Convert the item to a bool.

  • A Item::B(_) gets converted directly.
  • Any numeric item becomes false if zero, otherwise true.
  • Item::Nothing becomes false.

pub fn to_float(&self) -> Result<R64>[src]

Convert the item to a float value.

  • A Item::B(_) becomes 0f64 if false, 1f64 if true.
  • Any numeric item gets casted to a f64.
  • Item::Nothing returns an error.

pub fn is_unsigned(&self) -> bool[src]

Check whether the item is an unsigned type. Item::B(_) counts as unsigned.

pub fn to_unsigned(&self) -> Result<u64>[src]

Convert the item to a u64.

  • A Item::B(_) becomes 0u64 if false, 1u64 if true.
  • Any numeric item gets casted to a u64.
  • Item::Nothing returns an error.

pub fn is_signed(&self) -> bool[src]

Check whether the item is an unsigned type. Item::B(_) counts as unsigned.

pub fn to_signed(&self) -> Result<i64>[src]

Convert the item to a i64.

  • A Item::B(_) becomes 0i64 if false, 1i64 if true.
  • Any numeric item gets casted to a i64.
  • Item::Nothing returns an error.

pub fn counts_as_true(&self) -> bool[src]

Check whether the value counts as true.

  • Item::B(_) counts as it's enclosed value.
  • All numeric values count as true if not zero.
  • Item::Nothing counts as false.

Trait Implementations

impl From<bool> for Item[src]

impl From<i8> for Item[src]

impl From<i16> for Item[src]

impl From<i32> for Item[src]

impl From<i64> for Item[src]

impl From<u8> for Item[src]

impl From<u16> for Item[src]

impl From<u32> for Item[src]

impl From<u64> for Item[src]

impl From<f64> for Item[src]

impl From<ConstrainedFloat<f64, FiniteConstraint<f64>>> for Item[src]

impl From<f32> for Item[src]

impl From<ConstrainedFloat<f32, FiniteConstraint<f32>>> for Item[src]

impl<T> From<Option<T>> for Item where
    Item: From<T>, 
[src]

impl Clone for Item[src]

impl Default for Item[src]

impl Eq for Item[src]

impl Ord for Item[src]

impl PartialEq<Item> for Item[src]

impl PartialOrd<Item> for Item[src]

impl Debug for Item[src]

impl Serialize for Item[src]

impl<'de> Deserialize<'de> for Item[src]

Auto Trait Implementations

impl Send for Item

impl Sync for Item

impl Unpin for Item

impl UnwindSafe for Item

impl RefUnwindSafe for Item

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

impl<T> PathLoad for T where
    T: DeserializeOwned