Struct wasm_component_layer::List
source · 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 !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