pub struct List { /* private fields */ }
Expand description
Represents a list of values, all of the same type.
Implementations§
Source§impl List
impl List
Sourcepub fn new(
ty: ListType,
values: impl IntoIterator<Item = Value>,
) -> Result<Self>
pub fn new( ty: ListType, values: impl IntoIterator<Item = Value>, ) -> Result<Self>
Creates a new list with the provided values. Every value must match the element in the given list type.
Sourcepub fn typed<T: ListPrimitive>(&self) -> Result<&[T]>
pub fn typed<T: ListPrimitive>(&self) -> Result<&[T]>
Casts this list to a strongly-typed slice, if possible. For performance reasons, lists are specialized to store primitive types without any wrappers or indirection. This function allows one to access that representation.
Trait Implementations§
Source§impl<'a> IntoIterator for &'a List
impl<'a> IntoIterator for &'a List
Auto Trait Implementations§
impl Freeze for List
impl !RefUnwindSafe for List
impl Send for List
impl Sync for List
impl Unpin for List
impl !UnwindSafe for List
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