pub enum Value {
Undef {
dtype: Dtype,
},
Unit,
Int {
value: u128,
width: usize,
is_signed: bool,
},
Float {
value: OrderedFloat<f64>,
width: usize,
},
Pointer {
bid: Option<usize>,
offset: isize,
dtype: Dtype,
},
Array {
inner_dtype: Dtype,
values: Vec<Value>,
},
Struct {
name: String,
fields: Vec<Named<Value>>,
},
}
Variants§
Undef
Unit
Int
Float
Fields
§
value: OrderedFloat<f64>
value
may be f32
, but it is possible to consider it as f64
.
- Casting from an f32 to an f64 is perfect and lossless (f32 -> f64)
- Casting from an f64 to an f32 will produce the closest possible value (f64 -> f32)
For more details: https://doc.rust-lang.org/stable/reference/expressions/operator-expr.html#type-cast-expressions
Pointer
Array
Struct
Implementations§
Source§impl Value
impl Value
fn undef(dtype: Dtype) -> Self
fn unit() -> Self
fn int(value: u128, width: usize, is_signed: bool) -> Self
fn float(value: f64, width: usize) -> Self
fn pointer(bid: Option<usize>, offset: isize, dtype: Dtype) -> Self
fn array(inner_dtype: Dtype, values: Vec<Self>) -> Self
fn structure(name: String, fields: Vec<Named<Value>>) -> Self
pub fn get_int(&self) -> Option<(u128, usize, bool)>
fn get_pointer(&self) -> Option<(&Option<usize>, &isize, &Dtype)>
fn nullptr(dtype: Dtype) -> Self
fn default_from_dtype( dtype: &Dtype, structs: &HashMap<String, Option<Dtype>>, ) -> Result<Self, ()>
pub fn try_from_initializer( initializer: &Initializer, dtype: &Dtype, structs: &HashMap<String, Option<Dtype>>, ) -> Result<Self, ()>
Trait Implementations§
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more