pub enum StringKeyedValue {
Null,
Bool(bool),
Int(i64),
Float(f64),
String(String),
Path(String),
List(Vec<StringKeyedValue>),
Attrs(BTreeMap<String, StringKeyedValue>),
Lambda,
Thunk(Rc<dyn Fn() -> Result<StringKeyedValue, String>>),
Callable(Rc<dyn Fn(StringKeyedValue) -> Result<StringKeyedValue, String>>),
}Expand description
A string-keyed value for external API consumption.
Produced by VMValue::to_string_keyed. Uses BTreeMap<String, _>
for attrsets so callers don’t need access to the interner.
The Thunk variant carries a deferred computation from the tree-walker
bridge. When the VM encounters it during string_keyed_to_nanbox, it
wraps the callback in a VMThunk so the value is only evaluated when
actually accessed. This keeps getFlake fast by not eagerly resolving
all transitive flake inputs.
Variants§
Null
Bool(bool)
Int(i64)
Float(f64)
String(String)
Path(String)
List(Vec<StringKeyedValue>)
Attrs(BTreeMap<String, StringKeyedValue>)
Lambda
Thunk(Rc<dyn Fn() -> Result<StringKeyedValue, String>>)
A deferred value — evaluated on demand when the VM forces it.
The callback returns a StringKeyedValue which is then converted
to a NanBox by the VM. Uses Rc<dyn Fn()> for cheap cloning
and shared memoization.
Callable(Rc<dyn Fn(StringKeyedValue) -> Result<StringKeyedValue, String>>)
A callable tree-walker function wrapped as a bridge callback.
When the VM needs to call this, it converts args through the bridge and delegates to the tree-walker. Created when a Lambda or Builtin value crosses the tree-walker → VM boundary.
Trait Implementations§
Source§impl Clone for StringKeyedValue
impl Clone for StringKeyedValue
Source§impl Debug for StringKeyedValue
impl Debug for StringKeyedValue
Source§impl Display for StringKeyedValue
impl Display for StringKeyedValue
impl Eq for StringKeyedValue
Auto Trait Implementations§
impl !RefUnwindSafe for StringKeyedValue
impl !Send for StringKeyedValue
impl !Sync for StringKeyedValue
impl !UnwindSafe for StringKeyedValue
impl Freeze for StringKeyedValue
impl Unpin for StringKeyedValue
impl UnsafeUnpin for StringKeyedValue
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.