Struct alure::RegVal[][src]

pub struct RegVal(_);
Expand description

Register value, which may be None

Implementations

impl RegVal[src]

pub fn partial_cmp_op(
    num_type: NumType
) -> fn(_: RegVal, _: RegVal) -> Option<Ordering>
[src]

impl RegVal[src]

pub fn partial_cmp(self, num_type: NumType, other: Self) -> Option<Ordering>[src]

Compares two values according to given arithmetics

pub fn partial_cmp_uint(self, other: Self) -> Option<Ordering>[src]

Compares two values according to unsigned arithmetics

pub fn partial_cmp_int(self, other: Self) -> Option<Ordering>[src]

Compares two values according to unsigned arithmetics

pub fn partial_cmp_f23(self, other: Self) -> Option<Ordering>[src]

Compares two values according to short float arithmetics

pub fn partial_cmp_f52(self, other: Self) -> Option<Ordering>[src]

Compares two values according to long float arithmetics

impl RegVal[src]

pub fn none() -> RegVal[src]

Creates RegVal without assigning a value to it

pub fn some(val: Value) -> RegVal[src]

Creates RegVal assigning a value to it

Methods from Deref<Target = Option<Value>>

#[must_use = "if you intended to assert that this has a value, consider `.unwrap()` instead"]
pub const fn is_some(&self) -> bool
1.0.0 (const: 1.48.0)[src]

Returns true if the option is a Some value.

Examples

let x: Option<u32> = Some(2);
assert_eq!(x.is_some(), true);

let x: Option<u32> = None;
assert_eq!(x.is_some(), false);

#[must_use = "if you intended to assert that this doesn't have a value, consider \ `.and_then(|_| panic!(\"`Option` had a value when expected `None`\"))` instead"]
pub const fn is_none(&self) -> bool
1.0.0 (const: 1.48.0)[src]

Returns true if the option is a None value.

Examples

let x: Option<u32> = Some(2);
assert_eq!(x.is_none(), false);

let x: Option<u32> = None;
assert_eq!(x.is_none(), true);

#[must_use]
pub fn contains<U>(&self, x: &U) -> bool where
    U: PartialEq<T>, 
[src]

🔬 This is a nightly-only experimental API. (option_result_contains)

Returns true if the option is a Some value containing the given value.

Examples

#![feature(option_result_contains)]

let x: Option<u32> = Some(2);
assert_eq!(x.contains(&2), true);

let x: Option<u32> = Some(3);
assert_eq!(x.contains(&2), false);

let x: Option<u32> = None;
assert_eq!(x.contains(&2), false);

pub const fn as_ref(&self) -> Option<&T>1.0.0 (const: 1.48.0)[src]

Converts from &Option<T> to Option<&T>.

Examples

Converts an Option<String> into an Option<usize>, preserving the original. The map method takes the self argument by value, consuming the original, so this technique uses as_ref to first take an Option to a reference to the value inside the original.

let text: Option<String> = Some("Hello, world!".to_string());
// First, cast `Option<String>` to `Option<&String>` with `as_ref`,
// then consume *that* with `map`, leaving `text` on the stack.
let text_length: Option<usize> = text.as_ref().map(|s| s.len());
println!("still can print text: {:?}", text);

pub fn as_pin_ref(self: Pin<&Option<T>>) -> Option<Pin<&T>>1.33.0[src]

Converts from Pin<&Option<T>> to Option<Pin<&T>>.

pub fn as_pin_mut(self: Pin<&mut Option<T>>) -> Option<Pin<&mut T>>1.33.0[src]

Converts from Pin<&mut Option<T>> to Option<Pin<&mut T>>.

pub const fn iter(&self) -> Iter<'_, T>1.0.0[src]

Returns an iterator over the possibly contained value.

Examples

let x = Some(4);
assert_eq!(x.iter().next(), Some(&4));

let x: Option<u32> = None;
assert_eq!(x.iter().next(), None);

pub fn as_deref(&self) -> Option<&<T as Deref>::Target>1.40.0[src]

Converts from Option<T> (or &Option<T>) to Option<&T::Target>.

Leaves the original Option in-place, creating a new one with a reference to the original one, additionally coercing the contents via Deref.

Examples

let x: Option<String> = Some("hey".to_owned());
assert_eq!(x.as_deref(), Some("hey"));

let x: Option<String> = None;
assert_eq!(x.as_deref(), None);

Trait Implementations

impl Clone for RegVal[src]

fn clone(&self) -> RegVal[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for RegVal[src]

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

Formats the value using the given formatter. Read more

impl Default for RegVal[src]

fn default() -> RegVal[src]

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

impl Deref for RegVal[src]

type Target = Option<Value>

The resulting type after dereferencing.

fn deref(&self) -> &Self::Target[src]

Dereferences the value.

impl Display for RegVal[src]

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

Formats the value using the given formatter. Read more

impl From<&'_ Option<[u8; 1]>> for RegVal[src]

fn from(val: &Option<[u8; 1]>) -> RegVal[src]

Performs the conversion.

impl From<&'_ Option<[u8; 1024]>> for RegVal[src]

fn from(val: &Option<[u8; 1024]>) -> RegVal[src]

Performs the conversion.

impl From<&'_ Option<[u8; 128]>> for RegVal[src]

fn from(val: &Option<[u8; 128]>) -> RegVal[src]

Performs the conversion.

impl From<&'_ Option<[u8; 16]>> for RegVal[src]

fn from(val: &Option<[u8; 16]>) -> RegVal[src]

Performs the conversion.

impl From<&'_ Option<[u8; 2]>> for RegVal[src]

fn from(val: &Option<[u8; 2]>) -> RegVal[src]

Performs the conversion.

impl From<&'_ Option<[u8; 20]>> for RegVal[src]

fn from(val: &Option<[u8; 20]>) -> RegVal[src]

Performs the conversion.

impl From<&'_ Option<[u8; 256]>> for RegVal[src]

fn from(val: &Option<[u8; 256]>) -> RegVal[src]

Performs the conversion.

impl From<&'_ Option<[u8; 32]>> for RegVal[src]

fn from(val: &Option<[u8; 32]>) -> RegVal[src]

Performs the conversion.

impl From<&'_ Option<[u8; 4]>> for RegVal[src]

fn from(val: &Option<[u8; 4]>) -> RegVal[src]

Performs the conversion.

impl From<&'_ Option<[u8; 512]>> for RegVal[src]

fn from(val: &Option<[u8; 512]>) -> RegVal[src]

Performs the conversion.

impl From<&'_ Option<[u8; 64]>> for RegVal[src]

fn from(val: &Option<[u8; 64]>) -> RegVal[src]

Performs the conversion.

impl From<&'_ Option<[u8; 8]>> for RegVal[src]

fn from(val: &Option<[u8; 8]>) -> RegVal[src]

Performs the conversion.

impl From<&'_ Option<Value>> for RegVal[src]

fn from(val: &Option<Value>) -> Self[src]

Performs the conversion.

impl From<&'_ Option<i128>> for RegVal[src]

fn from(val: &Option<i128>) -> Self[src]

Performs the conversion.

impl From<&'_ Option<i16>> for RegVal[src]

fn from(val: &Option<i16>) -> Self[src]

Performs the conversion.

impl From<&'_ Option<i32>> for RegVal[src]

fn from(val: &Option<i32>) -> Self[src]

Performs the conversion.

impl From<&'_ Option<i64>> for RegVal[src]

fn from(val: &Option<i64>) -> Self[src]

Performs the conversion.

impl From<&'_ Option<i8>> for RegVal[src]

fn from(val: &Option<i8>) -> Self[src]

Performs the conversion.

impl From<&'_ Option<u1024>> for RegVal[src]

fn from(val: &Option<u1024>) -> Self[src]

Performs the conversion.

impl From<&'_ Option<u128>> for RegVal[src]

fn from(val: &Option<u128>) -> Self[src]

Performs the conversion.

impl From<&'_ Option<u16>> for RegVal[src]

fn from(val: &Option<u16>) -> Self[src]

Performs the conversion.

impl From<&'_ Option<u256>> for RegVal[src]

fn from(val: &Option<u256>) -> Self[src]

Performs the conversion.

impl From<&'_ Option<u32>> for RegVal[src]

fn from(val: &Option<u32>) -> Self[src]

Performs the conversion.

impl From<&'_ Option<u512>> for RegVal[src]

fn from(val: &Option<u512>) -> Self[src]

Performs the conversion.

impl From<&'_ Option<u64>> for RegVal[src]

fn from(val: &Option<u64>) -> Self[src]

Performs the conversion.

impl From<&'_ Option<u8>> for RegVal[src]

fn from(val: &Option<u8>) -> Self[src]

Performs the conversion.

impl From<&'_ Value> for RegVal[src]

fn from(val: &Value) -> Self[src]

Performs the conversion.

impl From<&'_ i128> for RegVal[src]

fn from(val: &i128) -> Self[src]

Performs the conversion.

impl From<&'_ i16> for RegVal[src]

fn from(val: &i16) -> Self[src]

Performs the conversion.

impl From<&'_ i32> for RegVal[src]

fn from(val: &i32) -> Self[src]

Performs the conversion.

impl From<&'_ i64> for RegVal[src]

fn from(val: &i64) -> Self[src]

Performs the conversion.

impl From<&'_ i8> for RegVal[src]

fn from(val: &i8) -> Self[src]

Performs the conversion.

impl From<&'_ u1024> for RegVal[src]

fn from(val: &u1024) -> Self[src]

Performs the conversion.

impl From<&'_ u128> for RegVal[src]

fn from(val: &u128) -> Self[src]

Performs the conversion.

impl From<&'_ u16> for RegVal[src]

fn from(val: &u16) -> Self[src]

Performs the conversion.

impl From<&'_ u256> for RegVal[src]

fn from(val: &u256) -> Self[src]

Performs the conversion.

impl From<&'_ u32> for RegVal[src]

fn from(val: &u32) -> Self[src]

Performs the conversion.

impl From<&'_ u512> for RegVal[src]

fn from(val: &u512) -> Self[src]

Performs the conversion.

impl From<&'_ u64> for RegVal[src]

fn from(val: &u64) -> Self[src]

Performs the conversion.

impl From<&'_ u8> for RegVal[src]

fn from(val: &u8) -> Self[src]

Performs the conversion.

impl From<[u8; 1]> for RegVal[src]

fn from(val: [u8; 1]) -> RegVal[src]

Performs the conversion.

impl From<[u8; 1024]> for RegVal[src]

fn from(val: [u8; 1024]) -> RegVal[src]

Performs the conversion.

impl From<[u8; 128]> for RegVal[src]

fn from(val: [u8; 128]) -> RegVal[src]

Performs the conversion.

impl From<[u8; 16]> for RegVal[src]

fn from(val: [u8; 16]) -> RegVal[src]

Performs the conversion.

impl From<[u8; 2]> for RegVal[src]

fn from(val: [u8; 2]) -> RegVal[src]

Performs the conversion.

impl From<[u8; 20]> for RegVal[src]

fn from(val: [u8; 20]) -> RegVal[src]

Performs the conversion.

impl From<[u8; 256]> for RegVal[src]

fn from(val: [u8; 256]) -> RegVal[src]

Performs the conversion.

impl From<[u8; 32]> for RegVal[src]

fn from(val: [u8; 32]) -> RegVal[src]

Performs the conversion.

impl From<[u8; 4]> for RegVal[src]

fn from(val: [u8; 4]) -> RegVal[src]

Performs the conversion.

impl From<[u8; 512]> for RegVal[src]

fn from(val: [u8; 512]) -> RegVal[src]

Performs the conversion.

impl From<[u8; 64]> for RegVal[src]

fn from(val: [u8; 64]) -> RegVal[src]

Performs the conversion.

impl From<[u8; 8]> for RegVal[src]

fn from(val: [u8; 8]) -> RegVal[src]

Performs the conversion.

impl From<Option<&'_ Value>> for RegVal[src]

fn from(val: Option<&Value>) -> Self[src]

Performs the conversion.

impl From<Option<&'_ i128>> for RegVal[src]

fn from(val: Option<&i128>) -> Self[src]

Performs the conversion.

impl From<Option<&'_ i16>> for RegVal[src]

fn from(val: Option<&i16>) -> Self[src]

Performs the conversion.

impl From<Option<&'_ i32>> for RegVal[src]

fn from(val: Option<&i32>) -> Self[src]

Performs the conversion.

impl From<Option<&'_ i64>> for RegVal[src]

fn from(val: Option<&i64>) -> Self[src]

Performs the conversion.

impl From<Option<&'_ i8>> for RegVal[src]

fn from(val: Option<&i8>) -> Self[src]

Performs the conversion.

impl From<Option<&'_ u1024>> for RegVal[src]

fn from(val: Option<&u1024>) -> Self[src]

Performs the conversion.

impl From<Option<&'_ u128>> for RegVal[src]

fn from(val: Option<&u128>) -> Self[src]

Performs the conversion.

impl From<Option<&'_ u16>> for RegVal[src]

fn from(val: Option<&u16>) -> Self[src]

Performs the conversion.

impl From<Option<&'_ u256>> for RegVal[src]

fn from(val: Option<&u256>) -> Self[src]

Performs the conversion.

impl From<Option<&'_ u32>> for RegVal[src]

fn from(val: Option<&u32>) -> Self[src]

Performs the conversion.

impl From<Option<&'_ u512>> for RegVal[src]

fn from(val: Option<&u512>) -> Self[src]

Performs the conversion.

impl From<Option<&'_ u64>> for RegVal[src]

fn from(val: Option<&u64>) -> Self[src]

Performs the conversion.

impl From<Option<&'_ u8>> for RegVal[src]

fn from(val: Option<&u8>) -> Self[src]

Performs the conversion.

impl From<Option<[u8; 1]>> for RegVal[src]

fn from(val: Option<[u8; 1]>) -> RegVal[src]

Performs the conversion.

impl From<Option<[u8; 1024]>> for RegVal[src]

fn from(val: Option<[u8; 1024]>) -> RegVal[src]

Performs the conversion.

impl From<Option<[u8; 128]>> for RegVal[src]

fn from(val: Option<[u8; 128]>) -> RegVal[src]

Performs the conversion.

impl From<Option<[u8; 16]>> for RegVal[src]

fn from(val: Option<[u8; 16]>) -> RegVal[src]

Performs the conversion.

impl From<Option<[u8; 2]>> for RegVal[src]

fn from(val: Option<[u8; 2]>) -> RegVal[src]

Performs the conversion.

impl From<Option<[u8; 20]>> for RegVal[src]

fn from(val: Option<[u8; 20]>) -> RegVal[src]

Performs the conversion.

impl From<Option<[u8; 256]>> for RegVal[src]

fn from(val: Option<[u8; 256]>) -> RegVal[src]

Performs the conversion.

impl From<Option<[u8; 32]>> for RegVal[src]

fn from(val: Option<[u8; 32]>) -> RegVal[src]

Performs the conversion.

impl From<Option<[u8; 4]>> for RegVal[src]

fn from(val: Option<[u8; 4]>) -> RegVal[src]

Performs the conversion.

impl From<Option<[u8; 512]>> for RegVal[src]

fn from(val: Option<[u8; 512]>) -> RegVal[src]

Performs the conversion.

impl From<Option<[u8; 64]>> for RegVal[src]

fn from(val: Option<[u8; 64]>) -> RegVal[src]

Performs the conversion.

impl From<Option<[u8; 8]>> for RegVal[src]

fn from(val: Option<[u8; 8]>) -> RegVal[src]

Performs the conversion.

impl From<Option<Value>> for RegVal[src]

fn from(v: Option<Value>) -> Self[src]

Performs the conversion.

impl From<Option<i128>> for RegVal[src]

fn from(val: Option<i128>) -> Self[src]

Performs the conversion.

impl From<Option<i16>> for RegVal[src]

fn from(val: Option<i16>) -> Self[src]

Performs the conversion.

impl From<Option<i32>> for RegVal[src]

fn from(val: Option<i32>) -> Self[src]

Performs the conversion.

impl From<Option<i64>> for RegVal[src]

fn from(val: Option<i64>) -> Self[src]

Performs the conversion.

impl From<Option<i8>> for RegVal[src]

fn from(val: Option<i8>) -> Self[src]

Performs the conversion.

impl From<Option<u1024>> for RegVal[src]

fn from(val: Option<u1024>) -> Self[src]

Performs the conversion.

impl From<Option<u128>> for RegVal[src]

fn from(val: Option<u128>) -> Self[src]

Performs the conversion.

impl From<Option<u16>> for RegVal[src]

fn from(val: Option<u16>) -> Self[src]

Performs the conversion.

impl From<Option<u256>> for RegVal[src]

fn from(val: Option<u256>) -> Self[src]

Performs the conversion.

impl From<Option<u32>> for RegVal[src]

fn from(val: Option<u32>) -> Self[src]

Performs the conversion.

impl From<Option<u512>> for RegVal[src]

fn from(val: Option<u512>) -> Self[src]

Performs the conversion.

impl From<Option<u64>> for RegVal[src]

fn from(val: Option<u64>) -> Self[src]

Performs the conversion.

impl From<Option<u8>> for RegVal[src]

fn from(val: Option<u8>) -> Self[src]

Performs the conversion.

impl From<RegVal> for Option<Value>[src]

fn from(val: RegVal) -> Self[src]

Performs the conversion.

impl From<Value> for RegVal[src]

fn from(val: Value) -> Self[src]

Performs the conversion.

impl From<i128> for RegVal[src]

fn from(val: i128) -> Self[src]

Performs the conversion.

impl From<i16> for RegVal[src]

fn from(val: i16) -> Self[src]

Performs the conversion.

impl From<i32> for RegVal[src]

fn from(val: i32) -> Self[src]

Performs the conversion.

impl From<i64> for RegVal[src]

fn from(val: i64) -> Self[src]

Performs the conversion.

impl From<i8> for RegVal[src]

fn from(val: i8) -> Self[src]

Performs the conversion.

impl From<u1024> for RegVal[src]

fn from(val: u1024) -> Self[src]

Performs the conversion.

impl From<u128> for RegVal[src]

fn from(val: u128) -> Self[src]

Performs the conversion.

impl From<u16> for RegVal[src]

fn from(val: u16) -> Self[src]

Performs the conversion.

impl From<u256> for RegVal[src]

fn from(val: u256) -> Self[src]

Performs the conversion.

impl From<u32> for RegVal[src]

fn from(val: u32) -> Self[src]

Performs the conversion.

impl From<u512> for RegVal[src]

fn from(val: u512) -> Self[src]

Performs the conversion.

impl From<u64> for RegVal[src]

fn from(val: u64) -> Self[src]

Performs the conversion.

impl From<u8> for RegVal[src]

fn from(val: u8) -> Self[src]

Performs the conversion.

impl Hash for RegVal[src]

fn hash<__H: Hasher>(&self, state: &mut __H)[src]

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

impl Not for RegVal[src]

type Output = RegVal

The resulting type after applying the ! operator.

fn not(self) -> Self::Output[src]

Performs the unary ! operation. Read more

impl PartialEq<RegVal> for RegVal[src]

fn eq(&self, other: &RegVal) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &RegVal) -> bool[src]

This method tests for !=.

impl Copy for RegVal[src]

impl Eq for RegVal[src]

impl StructuralEq for RegVal[src]

impl StructuralPartialEq for RegVal[src]

Auto Trait Implementations

impl RefUnwindSafe for RegVal

impl Send for RegVal

impl Sync for RegVal

impl Unpin for RegVal

impl UnwindSafe for RegVal

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

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.

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

Performs the conversion.

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.

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

Performs the conversion.