Struct

std::collections::list::ListBuilder!

source

Re-exported from alloc::collections::list::ListBuilder!.

forall T, 'k.
struct ListBuilder! { ... }

A list built front to back in one pass: push links a new last cell after the previous one, so the list comes out in push order with one cell per element and no recursion. finish ends it with a given tail.

Linear and restricted: finish consumes the builder, so no copy of it is left to link cells onto a list that has been handed out.

Methods

method newsource

fn new() -> ListBuilder![T, 'k] { ... }

A builder with no elements yet.

method pushsource

forall C, R, Q where Access[C -> 'k, R], Allocate[C -> 'k, Q].
fn push(&self, &cx: C, value: T) { ... }

Adds value at the end, in a new cell linked after the last one.

method finishsource

forall C, R where Access[C -> 'k, R].
fn finish(self, &cx: C, tail: List[T, 'k]) -> List[T, 'k] { ... }

The list pushed so far, followed by tail.