Struct alure::Value[][src]

pub struct Value {
    pub len: u16,
    pub bytes: [u8; 1024],
}
Expand description

Copy’able variable length slice

Fields

len: u16

Slice length

bytes: [u8; 1024]

Slice bytes

Implementations

impl Value[src]

pub fn step_op(arithm: Arithmetics, step: i8) -> impl Fn(Value) -> Option<Value>[src]

pub fn add_op(arithm: Arithmetics) -> fn(_: Value, _: Value) -> Option<Value>[src]

pub fn sub_op(arithm: Arithmetics) -> fn(_: Value, _: Value) -> Option<Value>[src]

pub fn mul_op(arithm: Arithmetics) -> fn(_: Value, _: Value) -> Option<Value>[src]

pub fn div_op(arithm: Arithmetics) -> fn(_: Value, _: Value) -> Option<Value>[src]

pub fn rem_op(arithm: Arithmetics) -> fn(_: Value, _: Value) -> Option<Value>[src]

impl Value[src]

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

Compares two values according to given arithmetics

pub fn cmp_uint(self, other: Self) -> Ordering[src]

Compares two values according to unsigned arithmetics

pub fn cmp_int(self, other: Self) -> Ordering[src]

Compares two values according to unsigned arithmetics

pub fn cmp_f23(self, other: Self) -> Ordering[src]

Compares two values according to short float arithmetics

pub fn cmp_f52(self, other: Self) -> Ordering[src]

Compares two values according to long float arithmetics

impl Value[src]

pub fn step_uint_checked(value: Value, step: i8) -> Option<Value>[src]

pub fn step_uint_unchecked(value: Value, step: i8) -> Option<Value>[src]

pub fn step_uint_ap(src: Value, step: i8) -> Option<Value>[src]

pub fn step_int_checked(src: Value, step: i8) -> Option<Value>[src]

pub fn step_int_unchecked(src: Value, step: i8) -> Option<Value>[src]

pub fn step_int_ap(src: Value, step: i8) -> Option<Value>[src]

pub fn step_float(src: Value, step: i8) -> Option<Value>[src]

pub fn step_float_ap(src: Value, step: i8) -> Option<Value>[src]

impl Value[src]

pub fn add_uint_checked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn add_uint_unchecked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn add_uint_ap(src1: Value, src2: Value) -> Option<Value>[src]

pub fn add_int_checked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn add_int_unchecked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn add_int_ap(src1: Value, src2: Value) -> Option<Value>[src]

pub fn add_float(src1: Value, src2: Value) -> Option<Value>[src]

pub fn add_float_ap(src1: Value, src2: Value) -> Option<Value>[src]

impl Value[src]

pub fn sub_uint_checked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn sub_uint_unchecked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn sub_uint_ap(src1: Value, src2: Value) -> Option<Value>[src]

pub fn sub_int_checked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn sub_int_unchecked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn sub_int_ap(src1: Value, src2: Value) -> Option<Value>[src]

pub fn sub_float(src1: Value, src2: Value) -> Option<Value>[src]

pub fn sub_float_ap(src1: Value, src2: Value) -> Option<Value>[src]

impl Value[src]

pub fn mul_uint_checked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn mul_uint_unchecked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn mul_uint_ap(src1: Value, src2: Value) -> Option<Value>[src]

pub fn mul_int_checked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn mul_int_unchecked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn mul_int_ap(src1: Value, src2: Value) -> Option<Value>[src]

pub fn mul_float(src1: Value, src2: Value) -> Option<Value>[src]

pub fn mul_float_ap(src1: Value, src2: Value) -> Option<Value>[src]

impl Value[src]

pub fn div_uint_checked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn div_uint_unchecked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn div_uint_ap(src1: Value, src2: Value) -> Option<Value>[src]

pub fn div_int_checked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn div_int_unchecked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn div_int_ap(src1: Value, src2: Value) -> Option<Value>[src]

pub fn div_float(src1: Value, src2: Value) -> Option<Value>[src]

pub fn div_float_ap(src1: Value, src2: Value) -> Option<Value>[src]

impl Value[src]

pub fn rem_uint_checked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn rem_uint_unchecked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn rem_uint_ap(src1: Value, src2: Value) -> Option<Value>[src]

pub fn rem_int_checked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn rem_int_unchecked(src1: Value, src2: Value) -> Option<Value>[src]

pub fn rem_int_ap(src1: Value, src2: Value) -> Option<Value>[src]

pub fn rem_float(src1: Value, src2: Value) -> Option<Value>[src]

pub fn rem_float_ap(src1: Value, src2: Value) -> Option<Value>[src]

impl Value[src]

pub fn scl(src1: Value, src2: Value) -> Value[src]

pub fn scr(src1: Value, src2: Value) -> Value[src]

impl Value[src]

pub fn zero(len: u16) -> Value[src]

Creates zero value of a given dimension

pub fn with(slice: impl AsRef<[u8]>) -> Value[src]

Constructs value from slice of bytes.

Panics if the length of the slice is greater than 1024 bytes.

pub fn count_ones(&self) -> u16[src]

Returns the number of ones in the binary representation of self.

pub fn clean(&mut self)[src]

Ensures that all non-value bits are set to zero

pub fn to_clean(self) -> Self[src]

Returns a copy where all non-value bits are set to zero

pub fn to_u1024(self) -> u1024[src]

Converts the value into u1024 integer

Trait Implementations

impl AsMut<[u8]> for Value[src]

fn as_mut(&mut self) -> &mut [u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Performs the conversion.

impl AsRef<[u8]> for Value[src]

fn as_ref(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Performs the conversion.

impl BitAnd<Value> for Value[src]

type Output = Value

The resulting type after applying the & operator.

fn bitand(self, rhs: Self) -> Self::Output[src]

Performs the & operation. Read more

impl BitOr<Value> for Value[src]

type Output = Value

The resulting type after applying the | operator.

fn bitor(self, rhs: Self) -> Self::Output[src]

Performs the | operation. Read more

impl BitXor<Value> for Value[src]

type Output = Value

The resulting type after applying the ^ operator.

fn bitxor(self, rhs: Self) -> Self::Output[src]

Performs the ^ operation. Read more

impl Clone for Value[src]

fn clone(&self) -> Value[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 Value[src]

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

Formats the value using the given formatter. Read more

impl Default for Value[src]

fn default() -> Value[src]

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

impl Display for Value[src]

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

Formats the value using the given formatter. Read more

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

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

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

Performs the conversion.

impl From<Value> for RegVal[src]

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

Performs the conversion.

impl From<i128> for Value[src]

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

Performs the conversion.

impl From<i16> for Value[src]

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

Performs the conversion.

impl From<i32> for Value[src]

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

Performs the conversion.

impl From<i64> for Value[src]

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

Performs the conversion.

impl From<i8> for Value[src]

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

Performs the conversion.

impl From<u1024> for Value[src]

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

Performs the conversion.

impl From<u128> for Value[src]

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

Performs the conversion.

impl From<u16> for Value[src]

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

Performs the conversion.

impl From<u256> for Value[src]

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

Performs the conversion.

impl From<u32> for Value[src]

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

Performs the conversion.

impl From<u512> for Value[src]

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

Performs the conversion.

impl From<u64> for Value[src]

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

Performs the conversion.

impl From<u8> for Value[src]

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

Performs the conversion.

impl Hash for Value[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 Index<u16> for Value[src]

type Output = u8

The returned type after indexing.

fn index(&self, index: u16) -> &Self::Output[src]

Performs the indexing (container[index]) operation. Read more

impl IndexMut<u16> for Value[src]

fn index_mut(&mut self, index: u16) -> &mut Self::Output[src]

Performs the mutable indexing (container[index]) operation. Read more

impl Not for Value[src]

type Output = Value

The resulting type after applying the ! operator.

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

Performs the unary ! operation. Read more

impl PartialEq<Value> for Value[src]

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

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

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Shl<Value> for Value[src]

type Output = Value

The resulting type after applying the << operator.

fn shl(self, rhs: Self) -> Self::Output[src]

Performs the << operation. Read more

impl Shr<Value> for Value[src]

type Output = Value

The resulting type after applying the >> operator.

fn shr(self, rhs: Self) -> Self::Output[src]

Performs the >> operation. Read more

impl Copy for Value[src]

impl Eq for Value[src]

Auto Trait Implementations

impl RefUnwindSafe for Value

impl Send for Value

impl Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

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.