pub enum Value {
Show 22 variants
Unit,
Bool(bool),
Int(i64),
Float(f64),
String(String),
Array(Arc<RwLock<Vec<Value>>>),
Tuple(Vec<Value>),
Struct(String, Arc<RwLock<HashMap<String, Value>>>),
Function(String),
NativeFn(String, fn(&mut Env, Vec<Value>) -> KoreResult<Value>),
ActorRef(ActorRef),
None,
Return(Box<Value>),
Break(Option<Box<Value>>),
Continue,
Result(bool, Box<Value>),
Closure(Vec<String>, Box<Expr>, Vec<HashMap<String, Value>>),
StructConstructor(String, Vec<String>),
JSX(VNode),
EnumVariant(String, String, Vec<Value>),
Poll(bool, Option<Box<Value>>),
Future(String, Arc<RwLock<HashMap<String, Value>>>),
}Expand description
Runtime value
Variants§
Unit
Bool(bool)
Int(i64)
Float(f64)
String(String)
Array(Arc<RwLock<Vec<Value>>>)
Tuple(Vec<Value>)
Struct(String, Arc<RwLock<HashMap<String, Value>>>)
Function(String)
NativeFn(String, fn(&mut Env, Vec<Value>) -> KoreResult<Value>)
ActorRef(ActorRef)
None
Return(Box<Value>)
Special value for return flow control
Break(Option<Box<Value>>)
Break from loop with optional value
Continue
Continue to next loop iteration
Result(bool, Box<Value>)
Result: Ok(true, val) or Err(false, val)
Closure(Vec<String>, Box<Expr>, Vec<HashMap<String, Value>>)
Closure: params, body, captured_scopes
StructConstructor(String, Vec<String>)
Struct Constructor: name, field_names
JSX(VNode)
JSX Element
EnumVariant(String, String, Vec<Value>)
Enum variant: (enum_name, variant_name, fields)
Poll(bool, Option<Box<Value>>)
Poll result for async: Ready(value) or Pending
Future(String, Arc<RwLock<HashMap<String, Value>>>)
Future state machine: (struct_name, state_struct, poll_fn_name)
Trait Implementations§
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.