pub enum CollectionCtor {
Vec,
Deque,
Map,
Set,
Counter,
MinHeap,
MaxHeap,
BitSet,
Grid,
Range,
Seq,
}Expand description
Built-in collection constructors (§6.1). Range and BitSet take no type
arguments; the others take one (Vec, Set, …) or two (Map).
Seq has no rows and no values. It is the compiler-internal pipeline
source (§6.3), threading an element type through what a lazy chain would
need; the pipeline is eager (ADR-028 decision 2), so no row answers one.
Nothing produces a Seq, nothing consumes one, and retiring the constructor
itself is a mechanical follow-up rather than a decision.
Variants§
Vec
Deque
Map
Set
Counter
MinHeap
MaxHeap
BitSet
Grid
Range
Seq
Compiler-internal lazy sequence (§6.3). Never appears in source.
Implementations§
Source§impl CollectionCtor
impl CollectionCtor
Sourcepub fn from_name(name: &str) -> Option<CollectionCtor>
pub fn from_name(name: &str) -> Option<CollectionCtor>
The constructor a source name denotes, or None for any other name.
The inverse of name, and the one authority for the
mapping: HIR resolves a constructor call through it and MIR picks the
allocation’s ctor through it, so the two cannot come to disagree about
which names construct a collection. Seq is deliberately absent — it is
compiler-internal and no source name reaches it (§6.3).
Trait Implementations§
Source§impl Clone for CollectionCtor
impl Clone for CollectionCtor
Source§fn clone(&self) -> CollectionCtor
fn clone(&self) -> CollectionCtor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more