Struct tvix_eval::NixList

source ·
#[repr(transparent)]
pub struct NixList(Rc<Vector<Value>>);

Tuple Fields§

§0: Rc<Vector<Value>>

Implementations§

source§

impl NixList

source

pub fn len(&self) -> usize

source

pub fn get(&self, i: usize) -> Option<&Value>

source

pub fn is_empty(&self) -> bool

source

pub fn construct(count: usize, stack_slice: Vec<Value>) -> Self

source

pub fn iter(&self) -> Iter<'_, Value>

source

pub fn ptr_eq(&self, other: &Self) -> bool

source

pub fn into_inner(self) -> Vector<Value>

source

pub fn from_vec(vs: Vec<Value>) -> Self

👎Deprecated: callers should avoid constructing from Vec
source

pub async fn sort_by(self, co: &GenCo, cmp: Value) -> Result<Self, ErrorKind>

Asynchronous sorting algorithm in which the comparator can make use of VM requests (required as builtins.sort uses comparators written in Nix).

This is a simple, optimised bubble sort implementation. The choice of algorithm is constrained by the comparator in Nix not being able to yield equality, and us being unable to use the standard library implementation of sorting (which is a lot longer, but a lot more efficient) here.

Trait Implementations§

source§

impl Arbitrary for NixList

§

type Parameters = <Value as Arbitrary>::Parameters

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
§

type Strategy = BoxedStrategy<NixList>

The type of Strategy used to generate values of type Self.
source§

fn arbitrary_with(args: Self::Parameters) -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
source§

fn arbitrary() -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
source§

impl Clone for NixList

source§

fn clone(&self) -> NixList

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NixList

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for NixList

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<Vector<Value>> for NixList

source§

fn from(vs: Vector<Value>) -> Self

Converts to this type from the input type.
source§

impl Index<usize> for NixList

§

type Output = Value

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<'a> IntoIterator for &'a NixList

§

type Item = &'a Value

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, Value>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl IntoIterator for NixList

§

type Item = Value

The type of the elements being iterated over.
§

type IntoIter = ConsumingIter<Value>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl TotalDisplay for NixList

source§

fn total_fmt(&self, f: &mut Formatter<'_>, set: &mut ThunkSet) -> Result

Auto Trait Implementations§

§

impl !RefUnwindSafe for NixList

§

impl !Send for NixList

§

impl !Sync for NixList

§

impl Unpin for NixList

§

impl !UnwindSafe for NixList

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,