logos.mem.collections.vec

Module mem · package logos-mem

Types

structVec

struct Vec

Growable heap-allocated array of T, contiguous in memory (Rust Vec analog). On drop, each live element is dropped and the buffer is freed.

Implements: Send Sync Index IndexMut IntoIterator FromIterator Drop Debug

Fields

cap: i64
len: i64
ptr: *mut T

Methods

fn into_iter(self: &Vec<T>) -> VecIter<T>

structVecIntoIter

struct VecIntoIter

Owning iterator over a Vec<T> (into_iter / for x in v); yields T by value. On drop, un-yielded elements are dropped and the buffer is deallocated.

Implements: Iterator DoubleEndedIterator ExactSizeIterator Drop

Fields

back_idx: i64
data: *const T
idx: i64
len: i64

structVecIter

struct VecIter

Borrowing iterator over a Vec<T> (Vec::iter() / for x in &v); yields &T. Owns nothing; Drop is a no-op. Mirrors Rust’s slice::Iter.

Implements: Iterator DoubleEndedIterator ExactSizeIterator

Fields

back_idx: i64
data: *const T
idx: i64
len: i64

structVecIterMut

struct VecIterMut

Mutable borrowing iterator over a Vec<T> (Vec::iter_mut()); yields &mut T.

Implements: Iterator

Fields

data: *mut T
idx: i64
len: i64

Functions

fnfrom_iter

fn from_iter(iter: I) -> Result

fniter_collect_result_vec

fn iter_collect_result_vec(iter: I) -> Result

Collects an iterator of Result<T, E> into Result<Vec<T>, E>, short-circuiting on the first Err.

fniter_collect_vec

fn iter_collect_vec(iter: I) -> Vec<T>

Drains an iterator into a new Vec<T>.

fniter_partition_vec

fn iter_partition_vec(iter: I, pred: fn(T) -> bool) -> ZipPair<Vec<T>, Vec<T>>

Splits an iterator into two Vecs by a predicate: items where pred is true go to first, the rest to second. Rust’s Iterator::partition::<Vec<T>> in free-fn form.

fnvec_contains

fn vec_contains(v: &Vec<T>, val: &T) -> bool

Returns true if v contains an element equal to val — linear scan, requires T: Eq. Free-fn form keeps the base impl<T> Vec<T> bound-free; see also Vec::contains.

fnvec_from_arr

fn vec_from_arr(arr: [T; 0]) -> Vec<T>

Builds a Vec from a fixed-size array, inferring element type and length from the argument shape (no turbofish). vec!(1, 2, 3) lowers to exactly this call.

fnvec_new

fn vec_new() -> Vec<T>

Creates an empty Vec<T>; allocates an initial capacity of 8 up front.