Struct runestick::Vec [−][src]
#[repr(transparent)]pub struct Vec { /* fields omitted */ }
Expand description
Struct representing a dynamic vector.
Examples
let mut vec = runestick::Vec::new(); assert!(vec.is_empty()); vec.push_value(42)?; vec.push_value(true)?; assert_eq!(2, vec.len()); assert_eq!(Some(42), vec.get_value(0)?); assert_eq!(Some(true), vec.get_value(1)?); assert_eq!(None::<bool>, vec.get_value(2)?);
Implementations
Sort the vector with the given comparison function.
Construct a new dynamic vector guaranteed to have at least the given capacity.
Convert into inner std vector.
Returns the number of elements in the dynamic vector, also referred to as its ‘length’.
Appends an element to the back of a dynamic vector, converting it as
necessary through the ToValue
trait.
Get the given value at the given index.
Get the mutable value at the given index.
Removes the last element from a dynamic vector and returns it, or
None
if it is empty.
Removes the element at the specified index from a dynamic vector.
Clears the vector, removing all values.
Note that this method has no effect on the allocated capacity of the vector.
Inserts an element at position index within the vector, shifting all elements after it to the right.
Extend this vector with something that implements the into_iter protocol.
Convert into a runestick iterator.
Trait Implementations
Try to convert to the given type, from the given value.
Hook to install more things into the module.
Auto Trait Implementations
impl !RefUnwindSafe for Vec
impl !UnwindSafe for Vec
Blanket Implementations
Mutably borrows from an owned value. Read more