Merge remote-tracking branch 'upstream/main' into aanderse/main
This commit is contained in:
commit
7eb94b72f9
26 changed files with 125 additions and 109 deletions
|
|
@ -134,7 +134,6 @@ use anyhow::Context as _;
|
|||
use anyhow::{bail, Result};
|
||||
use cstr::cstr;
|
||||
use lazy_static::lazy_static;
|
||||
use nix_bindings_bindgen_raw as raw;
|
||||
use nix_bindings_store::path::StorePath;
|
||||
use nix_bindings_store::store::{Store, StoreWeak};
|
||||
use nix_bindings_util::context::Context;
|
||||
|
|
@ -142,6 +141,7 @@ use nix_bindings_util::string_return::{
|
|||
callback_get_result_string, callback_get_result_string_data,
|
||||
};
|
||||
use nix_bindings_util::{check_call, check_call_opt_key, result_string_init};
|
||||
use nix_bindings_util_sys as raw;
|
||||
use std::ffi::{c_char, CString};
|
||||
use std::iter::FromIterator;
|
||||
use std::os::raw::c_uint;
|
||||
|
|
@ -669,9 +669,9 @@ impl EvalState {
|
|||
///
|
||||
/// Returns [`Err`] if evaluation failed or the value is not an attribute set.
|
||||
///
|
||||
/// Returns [`Ok(None)`] if the attribute is not present.
|
||||
/// Returns `Ok(None)` if the attribute is not present.
|
||||
///
|
||||
/// Returns [`Ok(Some(value))`] if the attribute is present.
|
||||
/// Returns `Ok(Some(value))` if the attribute is present.
|
||||
#[doc(alias = "nix_get_attr_byname")]
|
||||
#[doc(alias = "get_attr_byname")]
|
||||
#[doc(alias = "get_attr_opt")]
|
||||
|
|
@ -721,11 +721,11 @@ impl EvalState {
|
|||
/// Extracts an element from a [list][`ValueType::List`] Nix value by index.
|
||||
///
|
||||
/// Forces [evaluation](https://nix.dev/manual/nix/latest/language/evaluation.html) and verifies the value is a list.
|
||||
/// Forces evaluation of the selected element, similar to [`require_attrs_select`].
|
||||
/// Forces evaluation of the selected element, similar to [`Self::require_attrs_select`].
|
||||
///
|
||||
/// Returns [`Ok(Some(value))`] if the element is found.
|
||||
/// Returns `Ok(Some(value))` if the element is found.
|
||||
///
|
||||
/// Returns [`Ok(None)`] if the index is out of bounds.
|
||||
/// Returns `Ok(None)` if the index is out of bounds.
|
||||
///
|
||||
/// Returns [`Err`] if evaluation failed, the element contains an error (e.g., `throw`), or the value is not a list.
|
||||
#[doc(alias = "get")]
|
||||
|
|
@ -917,7 +917,7 @@ impl EvalState {
|
|||
/// Applies a function to an argument and returns the result.
|
||||
///
|
||||
/// Forces [evaluation](https://nix.dev/manual/nix/latest/language/evaluation.html) of the function application.
|
||||
/// For a lazy version, see [`new_value_apply`].
|
||||
/// For a lazy version, see [`Self::new_value_apply`].
|
||||
#[doc(alias = "nix_value_call")]
|
||||
#[doc(alias = "value_call")]
|
||||
#[doc(alias = "apply")]
|
||||
|
|
@ -999,7 +999,7 @@ impl EvalState {
|
|||
/// Applies a function to an argument lazily, creating a [thunk](https://nix.dev/manual/nix/latest/language/evaluation.html#laziness).
|
||||
///
|
||||
/// Does not force [evaluation](https://nix.dev/manual/nix/latest/language/evaluation.html) of the function application.
|
||||
/// For an eager version, see [`call`].
|
||||
/// For an eager version, see [`Self::call`].
|
||||
#[doc(alias = "lazy_apply")]
|
||||
#[doc(alias = "thunk_apply")]
|
||||
#[doc(alias = "defer_call")]
|
||||
|
|
@ -1046,10 +1046,10 @@ impl EvalState {
|
|||
Ok(value)
|
||||
}
|
||||
|
||||
/// Creates a new [attribute set][`ValueType::Attrs`] Nix value from an iterator of name-value pairs.
|
||||
/// Creates a new [attribute set][`ValueType::AttrSet`] Nix value from an iterator of name-value pairs.
|
||||
///
|
||||
/// Accepts any iterator that yields `(String, Value)` pairs and has an exact size.
|
||||
/// Common usage includes [`Vec`], [`HashMap`], and array literals.
|
||||
/// Common usage includes [`Vec`], [`std::collections::HashMap`], and array literals.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue