Struct lrs::vec::Vec

A vector.

Syntax

struct Vec<T, Heap = Libc>
    where Heap: Allocator,
{
    /* private fields */
}

Static methods

NameDescription
buffered

Creates a vector which is backed by borrowed memory.

from_raw_parts

Creates a new vector from its raw parts.

new

Creates a new allocating vector.

with_capacity

Creates a new allocating vector and reserves a certain amount of space for it.

with_pool

Creates a new allocating vector with a memory pool.

Methods

ReceiverNameDescription
&selfavailable

Returns the number of available but unused slots.

&selfcapacity

Returns the capacity of the vector.

&mut selfextend

Extends the vector by the elements of an iterator.

&mut selfpop

Removes an element from the end of the vector.

&mut selfpush

Appends an element to the vector.

&mut selfpush_all

Appends a slice of copyable elements to the vector.

&mut selfreserve

Reserves memory for additional elements.

&mut selfset_len

Sets the length of the vector.

&mut selfshrink_to_fit

Minimizes the amount of used memory.

&mut selftruncate

Reduces the length of the vector.

&mut selftry_push

Tries to append a copyable element to the vector.

&mut selftry_unsafe_push_all

Appends a slice of non-copyable elements to the vector.

&mut selfunused

Trait implementations

NameDescription
AsCStr

Objects that can be interpreted as CStrs.

AsMutCStr

Objects that can be interpreted as mutable CStrs.

AsMutNoNullStr

Objects that can be borrowed as a mutable NoNullStr.

AsNoNullStr

Objects that can be borrowed as a NoNullStr.

BufWrite

Objects that wrap a byte-stream for writing and contain a buffer.

Debug

Objects that can be formatted in a "debug" form.

Deref

Objects that implement the immutable dereference operator.

DerefMut

Objects that implement the mutable dereference operator.

Drop

Objects with a destructor.

Eq (2 times)

Objects that implement the binary == and != operators.

MaybeClone

Objects that can be duplicated.

Send

Objects whose ownership can be moved from one thread to another.

Sync

Objects that allow immutable access from threads other than their owning thread.

ToCStr

Objects that can be transformed into CStrs provided they have some scratch space available.

UndefState

Types that are not valid when they contain certain bit patterns.

Write

Objects that wrap a byte-stream for writing.