Lines Matching defs:values

1582 // The returned map has small keys and values.
1583 // Benchmarks on it have a counterpart in set.rs with the same keys and no values at all.
1588 // The returned map has small keys and large values.
6719 let values = vec![1, 2, 3, 4, 5];
6720 let slice = &values[1..3];
6727 let mut values = vec![1, 2, 3, 4, 5];
6729 let slice = &mut values[2..];
6736 assert!(values == [1, 2, 5, 6, 7]);
6741 let mut values = vec![1, 2, 3, 4, 5];
6743 let slice = &mut values[..2];
6750 assert!(values == [2, 3, 3, 4, 5]);
6755 let mut values = vec![1, 2, 3, 4, 5];
6757 let (left, right) = values.split_at_mut(2);
6775 assert_eq!(values, [2, 3, 5, 6, 7]);
10362 let mut values = [1, 2, 3, 4, 5];
10363 values[1..4].reverse();
10364 assert!(values == [1, 4, 3, 2, 5]);
10424 let mut values = [1, 2, 3, 4, 5];
10426 let (left, right) = values.split_at_mut(2);
10444 assert!(values == [2, 3, 5, 6, 7]);
10960 // Check that the most recent versions of values were dropped.
11798 // shift values 1 step to the right by pop, sub one, push
11817 // shift values 1 step to the right by pop, sub one, push
12184 // doesn't pop more values than are pushed
12209 // of values as iterating over both in sequence.
18667 /// Converts the given `String` to a vector `Vec` that holds values of type `u8`.
18963 /// values: Cow<'a, [X]>,
18968 /// Items { values: v }
18972 /// // Creates a container from borrowed values of a slice
18976 /// Items { values: Cow::Borrowed(b) } => println!("borrowed {:?}", b),
18982 /// clone_on_write.values.to_mut().push(3);
18983 /// println!("clone_on_write = {:?}", clone_on_write.values);
18987 /// Items { values: Cow::Owned(_) } => println!("clone_on_write contains owned data"),
19303 //! heap-allocated values.
19310 //! ## Boxed values
19646 //! place. In order to end up with two values that point at each other, one of
20122 /// let mut values = Rc::<[u32]>::new_uninit_slice(3);
20124 /// let values = unsafe {
20126 /// Rc::get_mut_unchecked(&mut values)[0].as_mut_ptr().write(1);
20127 /// Rc::get_mut_unchecked(&mut values)[1].as_mut_ptr().write(2);
20128 /// Rc::get_mut_unchecked(&mut values)[2].as_mut_ptr().write(3);
20130 /// values.assume_init()
20133 /// assert_eq!(*values, [1, 2, 3])
20153 /// let values = Rc::<[u32]>::new_zeroed_slice(3);
20154 /// let values = unsafe { values.assume_init() };
20156 /// assert_eq!(*values, [0, 0, 0])
20235 /// let mut values = Rc::<[u32]>::new_uninit_slice(3);
20237 /// let values = unsafe {
20239 /// Rc::get_mut_unchecked(&mut values)[0].as_mut_ptr().write(1);
20240 /// Rc::get_mut_unchecked(&mut values)[1].as_mut_ptr().write(2);
20241 /// Rc::get_mut_unchecked(&mut values)[2].as_mut_ptr().write(3);
20243 /// values.assume_init()
20246 /// assert_eq!(*values, [1, 2, 3])
20995 /// store large values, that are slow to clone, but also heavy to check for equality, causing this
21017 /// Two `Rc`s are equal if their inner values are equal, even if they are
21040 /// Two `Rc`s are unequal if their inner values are unequal.
21068 /// The two are compared by calling `partial_cmp()` on their inner values.
21087 /// The two are compared by calling `<` on their inner values.
21105 /// The two are compared by calling `<=` on their inner values.
21123 /// The two are compared by calling `>` on their inner values.
21141 /// The two are compared by calling `>=` on their inner values.
21162 /// The two are compared by calling `cmp()` on their inner values.
22796 // reuse the contained values' allocations/resources.
23895 /// let mut values = Arc::<[u32]>::new_uninit_slice(3);
23897 /// let values = unsafe {
23899 /// Arc::get_mut_unchecked(&mut values)[0].as_mut_ptr().write(1);
23900 /// Arc::get_mut_unchecked(&mut values)[1].as_mut_ptr().write(2);
23901 /// Arc::get_mut_unchecked(&mut values)[2].as_mut_ptr().write(3);
23903 /// values.assume_init()
23906 /// assert_eq!(*values, [1, 2, 3])
23926 /// let values = Arc::<[u32]>::new_zeroed_slice(3);
23927 /// let values = unsafe { values.assume_init() };
23929 /// assert_eq!(*values, [0, 0, 0])
24008 /// let mut values = Arc::<[u32]>::new_uninit_slice(3);
24010 /// let values = unsafe {
24012 /// Arc::get_mut_unchecked(&mut values)[0].as_mut_ptr().write(1);
24013 /// Arc::get_mut_unchecked(&mut values)[1].as_mut_ptr().write(2);
24014 /// Arc::get_mut_unchecked(&mut values)[2].as_mut_ptr().write(3);
24016 /// values.assume_init()
24019 /// assert_eq!(*values, [1, 2, 3])
25329 /// store large values, that are slow to clone, but also heavy to check for equality, causing this
25351 /// Two `Arc`s are equal if their inner values are equal, even if they are
25373 /// Two `Arc`s are unequal if their inner values are unequal.
25397 /// The two are compared by calling `partial_cmp()` on their inner values.
25415 /// The two are compared by calling `<` on their inner values.
25432 /// The two are compared by calling `<=` on their inner values.
25449 /// The two are compared by calling `>` on their inner values.
25466 /// The two are compared by calling `>=` on their inner values.
25485 /// The two are compared by calling `cmp()` on their inner values.
25964 //! default, and the negative sign is only printed by default for signed values.
26146 //! The values of these parameters will be listed in the fields of the
29472 // Controls the ordering of values wrapped by `Governed`.
29886 /// // look up the values associated with some keys.
29905 /// methods of getting, setting, updating and removing keys and their values:
30151 /// An iterator over the values of a `BTreeMap`.
30153 /// This `struct` is created by the [`values`] method on [`BTreeMap`]. See its
30156 /// [`values`]: BTreeMap::values
30169 /// A mutable iterator over the values of a `BTreeMap`.
30205 /// An owning iterator over the values of a `BTreeMap`.
31053 /// Creates a consuming iterator visiting all the values, in order by key.
31067 /// let values: Vec<&str> = a.into_values().collect();
31068 /// assert_eq!(values, ["hello", "goodbye"]);
31916 /// Gets an iterator over the values of the map, in order by key.
31929 /// let values: Vec<&str> = a.values().cloned().collect();
31930 /// assert_eq!(values, ["hello", "goodbye"]);
31933 pub fn values(&self) -> Values<'_, K, V> {
31937 /// Gets a mutable iterator over the values of the map, in order by key.
31954 /// let values: Vec<String> = a.values().cloned().collect();
31955 /// assert_eq!(values, [String::from("hello!"),
32310 Iterate(Iter<'a, T>), // simply produce all values in `self`
32446 /// Visits the values representing the difference,
32447 /// i.e., the values that are in `self` but not in `other`,
32507 /// Visits the values representing the symmetric difference,
32508 /// i.e., the values that are in `self` or in `other` but not in both,
32535 /// Visits the values representing the intersection,
32536 /// i.e., the values that are both in `self` and `other`,
32588 /// Visits the values representing the union,
32589 /// i.e., all the values in `self` or `other`, without duplicates,
32614 /// Clears the set, removing all values.
32705 /// i.e., `other` contains at least all the values in `self`.
32781 /// i.e., `self` contains at least all the values in `other`.
32809 /// This value is always the minimum of all values in the set.
32835 /// This value is always the maximum of all values in the set.
33117 /// values will still be subjected to the closure and removed and dropped if it returns true.
33119 /// It is unspecified how many more values will be subjected to the closure
33125 /// Splitting a set into even and odd values, reusing the original set:
33146 /// Gets an iterator that visits the values in the `BTreeSet` in ascending order.
33893 /// The results are non-unique references allowing mutation (of values only), so must be used
34047 /// only to be called when all keys and values have been returned,
34048 /// no cleanup is done on any of the keys or values.
34981 // Unlike the function with the same name in map/tests, returns no values.
35200 /// This method allows for generating key-derived values for insertion by providing the default
35818 assert_eq!(map.values().count(), 0);
35836 assert_eq!(map.values().collect::<Vec<_>>(), vec![&1]);
35844 assert_eq!(map.values().collect::<Vec<_>>(), vec![&2]);
35856 assert_eq!(map.values().collect::<Vec<_>>(), vec![&2, &4]);
35870 assert_eq!(map.values().collect::<Vec<_>>(), vec![&4]);
35882 assert_eq!(map.values().count(), 0);
35952 // Iterate forwards, trying to mutate to unique values
36027 let values: Vec<String> = a.values().cloned().collect();
36028 assert_eq!(values, [String::from("hello!"), String::from("goodbye!")]);
36105 assert_eq!(a.values().min(), None);
36106 assert_eq!(a.values().max(), None);
36121 assert_eq!(a.values().min(), Some(&24));
36122 assert_eq!(a.values().max(), Some(&42));
36509 // Explicitly consumes the iterator and modifies values through it.
36522 assert!(map.values().copied().eq(6..9));
36526 // Explicitly consumes the iterator and modifies values through it.
36937 // do not cause segfaults when used with zero-sized values. All other map behavior is
37201 fn values<T: Sync>(v: &BTreeMap<T, T>) -> impl Sync + '_ {
37202 v.values()
37270 fn values<T: Send + Sync>(v: &BTreeMap<T, T>) -> impl Send + '_ {
37271 v.values()
37314 map.values();
37330 format!("{:?}", map.values());
37696 let values: Vec<_> = map.into_values().collect();
37698 assert_eq!(values.len(), 3);
37699 assert!(values.contains(&'a'));
37700 assert!(values.contains(&'b'));
37701 assert!(values.contains(&'c'));
37949 // - A node of length `n` has `n` keys, `n` values, and `n + 1` edges.
37980 /// The number of keys and values this node stores.
38012 /// behind `BoxedNode`s to prevent dropping uninitialized keys and values. Any pointer to an
38065 /// mutable references to values throughout the tree to coexist.
38075 /// - `K` and `V`: These are the types of keys and values stored in the nodes.
38191 /// Finds the length of the node. This is the number of keys or values.
38197 // there might be outstanding mutable references to values that we must not invalidate.
38241 // there might be outstanding mutable references to values that we must not invalidate.
38486 /// no cleanup is done on any of the keys, values and other children.
38738 /// the keys, values and edges to the left of the split point become the left child;
38739 /// the keys, values and edges to the right of the split point become the right child.
38912 // values that we must not invalidate. There's no worry accessing the
39618 /// Moves all values from a slice of initialized elements to a slice
40053 // values are !Drop, thus won't suffer from double drops.
41547 // Drain will ptr::read out the values to remove.
41549 // and the head/tail values will be restored correctly.
41563 // have forgotten about the potentially moved values after the start of
41571 // "forget" about the values after the start of the drain until after
41590 /// Clears the `VecDeque`, removing all values.
43757 // Check that we iterate over the correct values
43785 // Check that we iterate over the correct values
43816 // Check that we drain the correct values
43827 // We should see the correct values in the VecDeque
44108 // This creates two deques for which values returned by as_slices
44491 /// // Wrap values in `Reverse`
44629 /// until it contains at least that many values.
45071 /// Returns an iterator visiting all values in the underlying vector, in
45249 /// Returns a slice of all values in the underlying vector, in arbitrary
46734 // drop any remaining values at the tail of the source
46835 //! You can [`push`] values onto the end of a vector (which will grow the vector
46844 //! Popping values works in much the same way:
47005 /// The `Vec` type allows to access values by index, because it implements the
48546 // Drain will ptr::read out the values to remove.
48568 /// Clears the vector, removing all values.
48680 /// calling the closure `f`. The return values from `f` will end up
48685 /// This method uses a closure to create new values on every push. If
48687 /// want to use the [`Default`] trait to generate values, you can
48999 /// Extend the vector by `n` values, using the given generator.
49108 // anything with the original values
49168 // reuse the contained values' allocations/resources.
50225 //! For non-zero-sized values, a [`Box`] will use the [`Global`] allocator for
50235 //! For zero-sized values, the `Box` pointer still has to be [valid] for reads
50282 //! and expect things to work. `Box<T>` values will always be fully aligned,
50707 /// let mut values = Box::<[u32]>::new_uninit_slice(3);
50709 /// let values = unsafe {
50711 /// values[0].as_mut_ptr().write(1);
50712 /// values[1].as_mut_ptr().write(2);
50713 /// values[2].as_mut_ptr().write(3);
50715 /// values.assume_init()
50718 /// assert_eq!(*values, [1, 2, 3])
50736 /// let values = Box::<[u32]>::new_zeroed_slice(3);
50737 /// let values = unsafe { values.assume_init() };
50739 /// assert_eq!(*values, [0, 0, 0])
50759 /// let mut values = Box::<[u32], _>::new_uninit_slice_in(3, System);
50761 /// let values = unsafe {
50763 /// values[0].as_mut_ptr().write(1);
50764 /// values[1].as_mut_ptr().write(2);
50765 /// values[2].as_mut_ptr().write(3);
50767 /// values.assume_init()
50770 /// assert_eq!(*values, [1, 2, 3])
50791 /// let values = Box::<[u32], _>::new_zeroed_slice_in(3, System);
50792 /// let values = unsafe { values.assume_init() };
50794 /// assert_eq!(*values, [0, 0, 0])
50848 /// it is up to the caller to guarantee that the values
50860 /// let mut values = Box::<[u32]>::new_uninit_slice(3);
50862 /// let values = unsafe {
50864 /// values[0].as_mut_ptr().write(1);
50865 /// values[1].as_mut_ptr().write(2);
50866 /// values[2].as_mut_ptr().write(3);
50868 /// values.assume_init()
50871 /// assert_eq!(*values, [1, 2, 3])