Crate len_trait [−] [src]
This crate generalises traits over the len
and capacity
methods found in most collections.
Methods that are included:
capacity
clear
is_empty
len
reserve_exact
reserve
shrink_to_fit
split_at_mut
split_at
split_off
truncate
with_capacity
Additionally, the traits IndexRanges<Idx>
and IndexRangesMut<Idx>
are provided for
"consistent slicing," i.e. slicing over all range types.
Modules
The len
module provides:
The capacity
module provides:
CapacityMut
, which requiresWithCapacity
WithCapacity
, which requiresCapacity
Capacity
, which requiresLen
.
The index
module provides:
IndexRanges<Idx>
, automatically implemented fromIndex<Idx>
IndexRangesMut<Idx>
, automatically implemented fromIndexMut<Idx>
SplitAt<Idx>
, which requiresIndexRanges<Idx>
SplitAtMut<Idx>
, which requiresIndexRangesMut<Idx>
Trait table
type | len |
capacity |
index |
---|---|---|---|
String |
LenMut |
CapacityMut |
X |
VecDeque |
LenMut |
CapacityMut |
X |
Vec |
LenMut |
CapacityMut |
X |
BinaryHeap |
Clear |
CapacityMut |
X |
BitSet |
Clear |
CapacityMut |
X |
BitVec |
Clear |
CapacityMut |
X |
HashMap |
Clear |
CapacityMut |
X |
HashSet |
Clear |
CapacityMut |
X |
IntervalHeap |
Clear |
CapacityMut |
X |
LinearMap |
Clear |
CapacityMut |
X |
LinkedHashMap |
Clear |
CapacityMut |
X |
OsString |
Clear |
CapacityMut |
X |
VecMap |
Clear |
CapacityMut |
X |
BList |
Clear |
X | X |
BTreeMap |
Clear |
X | X |
BTreeSet |
Clear |
X | X |
EnumSet |
Clear |
X | X |
LinkedList |
Clear |
X | X |
LruCache |
Clear |
X | X |
[T] |
Len |
X | SplitAtMut |
str |
Len |
X | SplitAtMut |
CStr |
Len |
X | X |
CString |
Len |
X | X |
OsStr |
Len |
X | X |
Reexports
pub use capacity::*; |
pub use index::*; |
pub use len::*; |
Modules
capacity |
Traits involving the capacity of a collection. |
index |
Traits involving collections which index over a particular type. |
len |
Traits involving the length of a collection. |