Struct std::Vec
generic<T> struct Vec {
?&heap T data;
unsigned long len;
unsigned long cap;
}Fields
element buffer; null while cap == 0
element count
allocated capacity, in elements
Methods
empty, no allocation
empty, room for cap elements
copies the elements
ensure cap >= new_cap; 0 on OOM
cap := len
null if out of range
bounds-checked: panics if out of range
the len elements; valid until the next growth
0 if out of range
0 on OOM
null if empty
idx <= len; shifts right
shifts left; null if out of range
len := 0, keeps the buffer
append the elements; 0 on OOM
ascending by cmp (<0, 0, >0); see vec_sort/vec_sort_by for inlined orderings
-1 if absent
shallow element copy
frees the buffer (Drop)
= drop()