collections - Rust
Description: API documentation for the Rust `collections` crate.
Keywords: rust, rustlang, rust-lang, collections

# Crate collections [−] [src]

Deprecated since 1.20.0

: collections moved to `alloc`

🔬 This is a nightly-only experimental API. (`collections` #27783)

this library is unlikely to be stabilized in its current form or name

Collection types

See `std::collections` for a detailed discussion of collections in Rust.

## Reexports

`pub use alloc::binary_heap::BinaryHeap;`
`pub use alloc::btree_map::BTreeMap;`
`pub use alloc::btree_set::BTreeSet;`
`pub use alloc::linked_list::LinkedList;`
`pub use alloc::vec_deque::VecDeque;`
`pub use alloc::string::String;`
`pub use alloc::vec::Vec;`

## Modules

binary_heap | A priority queue implemented with a binary heap.
borrow | A module for working with borrowed data.
btree_map | A map based on a B-Tree.
btree_set | A set based on a B-Tree.
fmt | Utilities for formatting and printing `String`s
linked_list | A doubly-linked list with owned nodes.
slice | A dynamically-sized view into a contiguous sequence, `[T]`.
str | Unicode string slices.
string | A UTF-8 encoded, growable string.
vec | A contiguous growable array type with heap-allocated contents, written `Vec<T>`.
vec_deque | A double-ended queue implemented with a growable ring buffer.
range | [ Experimental ] Range syntax.

## Macros

format | Use the syntax described in `std::fmt` to create a value of type `String`. See `std::fmt` for more information.
vec | Creates a `Vec` containing the arguments.

## Enums

Bound | An endpoint of a range of keys.

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)