Module vec

Module vec 

Source
Available on crate feature vec only.
Expand description

A dynamically sized contiguous sequence of values.

Structs§

NSTDVec
A dynamically sized contiguous sequence of values.

Functions§

nstd_vec_allocator
Returns an immutable reference to a vector’s allocator.
nstd_vec_as_ptr
Returns a pointer to a vector’s raw data.
nstd_vec_as_ptr_mut
Returns a pointer to a vector’s raw data.
nstd_vec_as_slice
Returns an immutable slice containing all of a vector’s active elements.
nstd_vec_as_slice_mut
Returns a slice containing all of a vector’s active elements.
nstd_vec_cap
Returns a vector’s capacity.
nstd_vec_clear
Sets a vector’s length to zero.
nstd_vec_clone
Creates a new deep copy of vec.
nstd_vec_drop
Frees an instance of NSTDVec after invoking callback with each of the vector’s elements.
nstd_vec_end
Returns a pointer to the end of a vector.
nstd_vec_end_mut
Returns a mutable pointer to the end of a vector.
nstd_vec_extend
Pushes a series of values onto a vector.
nstd_vec_free
Frees an instance of NSTDVec.
nstd_vec_from_slice
Creates a new vector from a slice.
nstd_vec_get
Returns an immutable pointer to the element at index pos in vec.
nstd_vec_get_mut
Returns a pointer to the element at index pos in vec.
nstd_vec_insert
Attempts to insert a value into a vector at index.
nstd_vec_len
Returns the length of a vector.
nstd_vec_new
Creates a new vector without allocating any resources.
nstd_vec_new_with_cap
Creates a new vector initialized with the given capacity.
nstd_vec_pop
Removes the last value of a vector and returns a pointer to it.
nstd_vec_push
Pushes a value onto a vector by copying bytes to the end of the vector’s buffer. The number of bytes to push is determined by vec’s stride.
nstd_vec_remove
Removes the element at index in a vector.
nstd_vec_reserve
Reserves some space on the heap for at least size more elements to be pushed onto a vector without making more allocations.
nstd_vec_reserved
Returns the number of reserved elements within a vector’s inactive buffer.
nstd_vec_set_len
Sets a vectors length.
nstd_vec_shrink
Decreases a vector’s capacity to match it’s length.
nstd_vec_stride
Returns the amount of bytes each value in a vector occupies.
nstd_vec_truncate
Shortens a vector, keeping the first len elements.

Type Aliases§

NSTDOptionalVec
Represents an optional value of type NSTDVec.