pub enum Value {
Null,
Bool(bool),
Int(i64),
Float(f64),
String(String),
Tensor(Tensor),
Reference(Reference),
Expression(Expression),
}Expand description
Re-export core types for convenience. A scalar value in HEDL.
Variants§
Null
Null value (~).
Bool(bool)
Boolean value (true/false).
Int(i64)
Integer value.
Float(f64)
Floating-point value.
String(String)
String value.
Tensor(Tensor)
Tensor (multi-dimensional array).
Reference(Reference)
Reference to another node.
Expression(Expression)
Parsed expression from $(…).
Implementations§
Source§impl Value
impl Value
Sourcepub fn is_reference(&self) -> bool
pub fn is_reference(&self) -> bool
Returns true if this value is a reference.
Sourcepub fn as_reference(&self) -> Option<&Reference>
pub fn as_reference(&self) -> Option<&Reference>
Try to get the value as a reference.
Source§impl Value
impl Value
Sourcepub fn as_expression(&self) -> Option<&Expression>
pub fn as_expression(&self) -> Option<&Expression>
Try to get the expression if this is an Expression variant.
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