| 1 | use craterust-analyzer cargo cc-traits 2.0.0 crate/::*; |
| 2 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::{Indexrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#, IndexMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#}; |
| 3 | |
| 4 | /// Collection with mutable capacity. |
| 5 | pub trait CapacityMutrust-analyzer cargo cc-traits 2.0.0 non_alias/CapacityMut#: Capacityrust-analyzer cargo cc-traits 2.0.0 Capacity# + Reserverust-analyzer cargo cc-traits 2.0.0 Reserve# {} |
| 6 | |
| 7 | impl<C: Capacityrust-analyzer cargo cc-traits 2.0.0 Capacity# + Reserverust-analyzer cargo cc-traits 2.0.0 Reserve#> CapacityMutrust-analyzer cargo cc-traits 2.0.0 non_alias/CapacityMut# for C {} |
| 8 | |
| 9 | /// Immutable stack data structure. |
| 10 | /// |
| 11 | /// A stack provides two main operations: |
| 12 | /// - [`PushBack::push_back`], which adds an element to the collection, and |
| 13 | /// - [`PopBack::pop_back`], which removes the most recently added element that was not yet removed. |
| 14 | /// |
| 15 | /// This trait alias describes the immutables operations derived from the two main operation above: |
| 16 | /// - [`Len::len`], returning the number of elements in the stack, and |
| 17 | /// - [`Back::back`], returning a reference to the most recently added element that was not yet removed. |
| 18 | pub trait Stackrust-analyzer cargo cc-traits 2.0.0 non_alias/Stack#<T>: Collectionrust-analyzer cargo cc-traits 2.0.0 Collection#<Itemrust-analyzer cargo cc-traits 2.0.0 Collection#Item# = T> + Lenrust-analyzer cargo cc-traits 2.0.0 Len# + Backrust-analyzer cargo cc-traits 2.0.0 Back# {} |
| 19 | |
| 20 | impl<T, C: Collectionrust-analyzer cargo cc-traits 2.0.0 Collection#<Itemrust-analyzer cargo cc-traits 2.0.0 Collection#Item# = T> + Lenrust-analyzer cargo cc-traits 2.0.0 Len# + Backrust-analyzer cargo cc-traits 2.0.0 Back#> Stackrust-analyzer cargo cc-traits 2.0.0 non_alias/Stack#<T> for C {} |
| 21 | |
| 22 | /// Mutable stack data structure. |
| 23 | /// |
| 24 | /// This trait alias describes the mutables operations on a stack. |
| 25 | /// See [`Stack`] for more details. |
| 26 | pub trait StackMutrust-analyzer cargo cc-traits 2.0.0 non_alias/StackMut#<T>: Stackrust-analyzer cargo cc-traits 2.0.0 non_alias/Stack#<T> + BackMutrust-analyzer cargo cc-traits 2.0.0 BackMut# + PushBackrust-analyzer cargo cc-traits 2.0.0 PushBack# + PopBackrust-analyzer cargo cc-traits 2.0.0 PopBack# {} |
| 27 | |
| 28 | impl<T, C: Stackrust-analyzer cargo cc-traits 2.0.0 non_alias/Stack#<T> + BackMutrust-analyzer cargo cc-traits 2.0.0 BackMut# + PushBackrust-analyzer cargo cc-traits 2.0.0 PushBack# + PopBackrust-analyzer cargo cc-traits 2.0.0 PopBack#> StackMutrust-analyzer cargo cc-traits 2.0.0 non_alias/StackMut#<T> for C {} |
| 29 | |
| 30 | /// Immutable array data structure (conventionally nammed "Vec"). |
| 31 | /// |
| 32 | /// A Vec is essentially a [`Stack`] indexable by a `usize`. |
| 33 | pub trait Vecrust-analyzer cargo cc-traits 2.0.0 non_alias/Vec#<T>: Stackrust-analyzer cargo cc-traits 2.0.0 non_alias/Stack#<T> + Indexrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#<usize, Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#Output# = T> {} |
| 34 | |
| 35 | impl<T, C: Stackrust-analyzer cargo cc-traits 2.0.0 non_alias/Stack#<T> + Indexrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#<usize, Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#Output# = T>> Vecrust-analyzer cargo cc-traits 2.0.0 non_alias/Vec#<T> for C {} |
| 36 | |
| 37 | /// Mutable Vec data structure. |
| 38 | /// |
| 39 | /// This trait alias describes the mutables operations on a Vec. |
| 40 | /// See [`Vec`] for more details. |
| 41 | pub trait VecMutrust-analyzer cargo cc-traits 2.0.0 non_alias/VecMut#<T>: Vecrust-analyzer cargo cc-traits 2.0.0 non_alias/Vec#<T> + StackMutrust-analyzer cargo cc-traits 2.0.0 non_alias/StackMut#<T> + IndexMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#<usize> {} |
| 42 | |
| 43 | impl<T, C: Vecrust-analyzer cargo cc-traits 2.0.0 non_alias/Vec#<T> + StackMutrust-analyzer cargo cc-traits 2.0.0 non_alias/StackMut#<T> + IndexMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#<usize>> VecMutrust-analyzer cargo cc-traits 2.0.0 non_alias/VecMut#<T> for C {} |
| 44 | |
| 45 | /// Immutable double-ended queue. |
| 46 | /// |
| 47 | /// A double-ended queue (abbreviated to deque) is a generalization of a stack in which |
| 48 | /// elements can be added and removed from both ends. |
| 49 | /// Such a data structure provides two additional operations compared to regular stacks: |
| 50 | /// - [`PushFront::push_front`], which adds an element to the front of collection, and |
| 51 | /// - [`PopFront::pop_front`], which removes the front element of the collection. |
| 52 | /// |
| 53 | /// This trait alias describes the immutables operations available on deques. |
| 54 | pub trait Dequerust-analyzer cargo cc-traits 2.0.0 non_alias/Deque#<T>: Stackrust-analyzer cargo cc-traits 2.0.0 non_alias/Stack#<T> + Frontrust-analyzer cargo cc-traits 2.0.0 Front# {} |
| 55 | |
| 56 | impl<T, C: Stackrust-analyzer cargo cc-traits 2.0.0 non_alias/Stack#<T> + Frontrust-analyzer cargo cc-traits 2.0.0 Front#> Dequerust-analyzer cargo cc-traits 2.0.0 non_alias/Deque#<T> for C {} |
| 57 | |
| 58 | /// Mutable double-ended queue. |
| 59 | /// |
| 60 | /// This trait alias describes the mutables operations on a deque. |
| 61 | /// See [`Deque`] for more details. |
| 62 | pub trait DequeMutrust-analyzer cargo cc-traits 2.0.0 non_alias/DequeMut#<T>: StackMutrust-analyzer cargo cc-traits 2.0.0 non_alias/StackMut#<T> + FrontMutrust-analyzer cargo cc-traits 2.0.0 FrontMut# + PushFrontrust-analyzer cargo cc-traits 2.0.0 PushFront# + PopFrontrust-analyzer cargo cc-traits 2.0.0 PopFront# {} |
| 63 | |
| 64 | impl<T, C: StackMutrust-analyzer cargo cc-traits 2.0.0 non_alias/StackMut#<T> + FrontMutrust-analyzer cargo cc-traits 2.0.0 FrontMut# + PushFrontrust-analyzer cargo cc-traits 2.0.0 PushFront# + PopFrontrust-analyzer cargo cc-traits 2.0.0 PopFront#> DequeMutrust-analyzer cargo cc-traits 2.0.0 non_alias/DequeMut#<T> for C {} |
| 65 | |
| 66 | /// Immutable indexable deque. |
| 67 | /// |
| 68 | /// See [`Deque`] and [`Vec`] for more details. |
| 69 | pub trait VecDequerust-analyzer cargo cc-traits 2.0.0 non_alias/VecDeque#<T>: Dequerust-analyzer cargo cc-traits 2.0.0 non_alias/Deque#<T> + Vecrust-analyzer cargo cc-traits 2.0.0 non_alias/Vec#<T> {} |
| 70 | |
| 71 | impl<T, C: Dequerust-analyzer cargo cc-traits 2.0.0 non_alias/Deque#<T> + Vecrust-analyzer cargo cc-traits 2.0.0 non_alias/Vec#<T>> VecDequerust-analyzer cargo cc-traits 2.0.0 non_alias/VecDeque#<T> for C {} |
| 72 | |
| 73 | /// Mutable indexable deque. |
| 74 | /// |
| 75 | /// See [`VecDeque`], [`DequeMut`] and [`VecMut`] for more details. |
| 76 | pub trait VecDequeMutrust-analyzer cargo cc-traits 2.0.0 non_alias/VecDequeMut#<T>: VecDequerust-analyzer cargo cc-traits 2.0.0 non_alias/VecDeque#<T> + DequeMutrust-analyzer cargo cc-traits 2.0.0 non_alias/DequeMut#<T> + VecMutrust-analyzer cargo cc-traits 2.0.0 non_alias/VecMut#<T> {} |
| 77 | |
| 78 | impl<T, C: VecDequerust-analyzer cargo cc-traits 2.0.0 non_alias/VecDeque#<T> + DequeMutrust-analyzer cargo cc-traits 2.0.0 non_alias/DequeMut#<T> + VecMutrust-analyzer cargo cc-traits 2.0.0 non_alias/VecMut#<T>> VecDequeMutrust-analyzer cargo cc-traits 2.0.0 non_alias/VecDequeMut#<T> for C {} |
| 79 | |
| 80 | /// Imutable set data structure. |
| 81 | /// |
| 82 | /// A set is an unordered collection storing at most one single copy of each element. |
| 83 | pub trait Setrust-analyzer cargo cc-traits 2.0.0 non_alias/Set#<T>: Collectionrust-analyzer cargo cc-traits 2.0.0 Collection#<Itemrust-analyzer cargo cc-traits 2.0.0 Collection#Item# = T> + Lenrust-analyzer cargo cc-traits 2.0.0 Len# + for<'a> Getrust-analyzer cargo cc-traits 2.0.0 Get#<&'a T> {} |
| 84 | |
| 85 | impl<T, C: Collectionrust-analyzer cargo cc-traits 2.0.0 Collection#<Itemrust-analyzer cargo cc-traits 2.0.0 Collection#Item# = T> + Lenrust-analyzer cargo cc-traits 2.0.0 Len# + for<'a> Getrust-analyzer cargo cc-traits 2.0.0 Get#<&'a T>> Setrust-analyzer cargo cc-traits 2.0.0 non_alias/Set#<T> for C {} |
| 86 | |
| 87 | /// Mutable set data structure. |
| 88 | pub trait SetMutrust-analyzer cargo cc-traits 2.0.0 non_alias/SetMut#<T>: Setrust-analyzer cargo cc-traits 2.0.0 non_alias/Set#<T> + Insertrust-analyzer cargo cc-traits 2.0.0 Insert#<Outputrust-analyzer cargo cc-traits 2.0.0 Insert#Output# = bool> + for<'a> Removerust-analyzer cargo cc-traits 2.0.0 Remove#<&'a T> {} |
| 89 | |
| 90 | impl<T, C: Setrust-analyzer cargo cc-traits 2.0.0 non_alias/Set#<T> + Insertrust-analyzer cargo cc-traits 2.0.0 Insert#<Outputrust-analyzer cargo cc-traits 2.0.0 Insert#Output# = bool> + for<'a> Removerust-analyzer cargo cc-traits 2.0.0 Remove#<&'a T>> SetMutrust-analyzer cargo cc-traits 2.0.0 non_alias/SetMut#<T> for C {} |
| 91 | |
| 92 | /// Imutable map data structure. |
| 93 | /// |
| 94 | /// A map is an unordered collection storing key-value pairs, indexed by the key. |
| 95 | pub trait Maprust-analyzer cargo cc-traits 2.0.0 non_alias/Map#<K, V>: |
| 96 | Keyedrust-analyzer cargo cc-traits 2.0.0 Keyed#<Keyrust-analyzer cargo cc-traits 2.0.0 Keyed#Key# = K, Itemrust-analyzer cargo cc-traits 2.0.0 Collection#Item# = V> + Lenrust-analyzer cargo cc-traits 2.0.0 Len# + for<'a> Getrust-analyzer cargo cc-traits 2.0.0 Get#<&'a K> + for<'a> GetKeyValuerust-analyzer cargo cc-traits 2.0.0 GetKeyValue#<&'a K> |
| 97 | { |
| 98 | } |
| 99 | |
| 100 | impl<K, V, C: Keyedrust-analyzer cargo cc-traits 2.0.0 Keyed#<Keyrust-analyzer cargo cc-traits 2.0.0 Keyed#Key# = K, Itemrust-analyzer cargo cc-traits 2.0.0 Collection#Item# = V> + Lenrust-analyzer cargo cc-traits 2.0.0 Len# + for<'a> Getrust-analyzer cargo cc-traits 2.0.0 Get#<&'a K> + for<'a> GetKeyValuerust-analyzer cargo cc-traits 2.0.0 GetKeyValue#<&'a K>> |
| 101 | Maprust-analyzer cargo cc-traits 2.0.0 non_alias/Map#<K, V> for C |
| 102 | { |
| 103 | } |
| 104 | |
| 105 | /// Mutable map data structure. |
| 106 | pub trait MapMutrust-analyzer cargo cc-traits 2.0.0 non_alias/MapMut#<K, V>: |
| 107 | Maprust-analyzer cargo cc-traits 2.0.0 non_alias/Map#<K, V> + for<'a> GetMutrust-analyzer cargo cc-traits 2.0.0 GetMut#<&'a K> + MapInsertrust-analyzer cargo cc-traits 2.0.0 MapInsert#<K, Outputrust-analyzer cargo cc-traits 2.0.0 MapInsert#Output# = Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<V>> + for<'a> Removerust-analyzer cargo cc-traits 2.0.0 Remove#<&'a K> |
| 108 | { |
| 109 | } |
| 110 | |
| 111 | impl< |
| 112 | K, |
| 113 | V, |
| 114 | C: Maprust-analyzer cargo cc-traits 2.0.0 non_alias/Map#<K, V> |
| 115 | + for<'a> GetMutrust-analyzer cargo cc-traits 2.0.0 GetMut#<&'a K> |
| 116 | + MapInsertrust-analyzer cargo cc-traits 2.0.0 MapInsert#<K, Outputrust-analyzer cargo cc-traits 2.0.0 MapInsert#Output# = Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<V>> |
| 117 | + for<'a> Removerust-analyzer cargo cc-traits 2.0.0 Remove#<&'a K>, |
| 118 | > MapMutrust-analyzer cargo cc-traits 2.0.0 non_alias/MapMut#<K, V> for C |
| 119 | { |
| 120 | } |
| 121 | |
| 122 | /// Imutable slab data structure. |
| 123 | /// |
| 124 | /// A slab is a linear collection storing each element at a given index. |
| 125 | /// The index of the element is allocated and returned upon insertion. |
| 126 | pub trait Slabrust-analyzer cargo cc-traits 2.0.0 non_alias/Slab#<T>: Collectionrust-analyzer cargo cc-traits 2.0.0 Collection#<Itemrust-analyzer cargo cc-traits 2.0.0 Collection#Item# = T> + Lenrust-analyzer cargo cc-traits 2.0.0 Len# + Getrust-analyzer cargo cc-traits 2.0.0 Get#<usize> {} |
| 127 | |
| 128 | impl<T, C: Collectionrust-analyzer cargo cc-traits 2.0.0 Collection#<Itemrust-analyzer cargo cc-traits 2.0.0 Collection#Item# = T> + Lenrust-analyzer cargo cc-traits 2.0.0 Len# + Getrust-analyzer cargo cc-traits 2.0.0 Get#<usize>> Slabrust-analyzer cargo cc-traits 2.0.0 non_alias/Slab#<T> for C {} |
| 129 | |
| 130 | /// Mutable slab data structure. |
| 131 | pub trait SlabMutrust-analyzer cargo cc-traits 2.0.0 non_alias/SlabMut#<T>: Slabrust-analyzer cargo cc-traits 2.0.0 non_alias/Slab#<T> + GetMutrust-analyzer cargo cc-traits 2.0.0 GetMut#<usize> + Insertrust-analyzer cargo cc-traits 2.0.0 Insert#<Outputrust-analyzer cargo cc-traits 2.0.0 Insert#Output# = usize> + Removerust-analyzer cargo cc-traits 2.0.0 Remove#<usize> {} |
| 132 | |
| 133 | impl<T, C: Slabrust-analyzer cargo cc-traits 2.0.0 non_alias/Slab#<T> + GetMutrust-analyzer cargo cc-traits 2.0.0 GetMut#<usize> + Insertrust-analyzer cargo cc-traits 2.0.0 Insert#<Outputrust-analyzer cargo cc-traits 2.0.0 Insert#Output# = usize> + Removerust-analyzer cargo cc-traits 2.0.0 Remove#<usize>> SlabMutrust-analyzer cargo cc-traits 2.0.0 non_alias/SlabMut#<T> for C {} |