pub struct Value<'a> { /* private fields */ }Expand description
A Nix value.
This represents any value in the Nix language, including primitives, collections, and functions.
Implementations§
Source§impl Value<'_>
impl Value<'_>
Sourcepub fn force(&mut self) -> Result<()>
pub fn force(&mut self) -> Result<()>
Force evaluation of this value.
If the value is a thunk, this will evaluate it to its final form.
§Errors
Returns an error if evaluation fails.
Sourcepub fn force_deep(&mut self) -> Result<()>
pub fn force_deep(&mut self) -> Result<()>
Force deep evaluation of this value.
This forces evaluation of the value and all its nested components.
§Errors
Returns an error if evaluation fails.
Sourcepub fn value_type(&self) -> ValueType
pub fn value_type(&self) -> ValueType
Get the type of this value.
Sourcepub fn to_nix_string(&self) -> Result<String>
pub fn to_nix_string(&self) -> Result<String>
Format this value as Nix syntax.
This provides a string representation that matches Nix’s own syntax, making it useful for debugging and displaying values to users.
§Errors
Returns an error if the value cannot be converted to a string representation.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Value<'a>
impl<'a> RefUnwindSafe for Value<'a>
impl<'a> !Send for Value<'a>
impl<'a> !Sync for Value<'a>
impl<'a> Unpin for Value<'a>
impl<'a> UnwindSafe for Value<'a>
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