Debian Codegraph @

src/ring_buffer/base.rs

raw symbols SCIP
1 use craterust-analyzer cargo ringbuf 0.3.3 crate/::utilsrust-analyzer cargo ringbuf 0.3.3 utils/::ring_buffer_rangesrust-analyzer cargo ringbuf 0.3.3 utils/ring_buffer_ranges().;
2 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::{memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::MaybeUninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/MaybeUninit#, numrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/::NonZeroUsizerust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/NonZeroUsize#, opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#, ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/};
3
4 /// Basic ring buffer functionality.
5 ///
6 /// Provides an access to raw underlying memory and `head`/`tail` counters.
7 ///
8 /// *It is recommended not to use this trait directly. Use [`Producer`](`crate::Producer`) and [`Consumer`](`crate::Consumer`) instead.*
9 ///
10 /// # Details
11 ///
12 /// The ring buffer consists of an array (of `capacity` size) and two counters: `head` and `tail`.
13 /// When an item is extracted from the ring buffer it is taken from the `head` position and after that `head` is incremented.
14 /// New item is appended to the `tail` position and `tail` is incremented after that.
15 ///
16 /// The `head` and `tail` counters are modulo `2 * capacity` (not just `capacity`).
17 /// It allows us to distinguish situations when the buffer is empty (`head == tail`) and when the buffer is full (`tail - head` modulo `2 * capacity` equals to `capacity`)
18 /// without using the space for an extra element in container.
19 /// And obviously we cannot store more than `capacity` items in the buffer, so `tail - head` modulo `2 * capacity` is not allowed to be greater than `capacity`.
20 pub trait RbBaserust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#<T> {
21 /// Returns part of underlying raw ring buffer memory as slices.
22 ///
23 /// For more information see [`SharedStorage::as_mut_slices`](`crate::ring_buffer::storage::SharedStorage::as_mut_slices`).
24 ///
25 /// # Safety
26 ///
27 /// Only non-overlapping slices allowed to exist at the same time.
28 ///
29 /// Modifications of this data must properly update `head` and `tail` positions.
30 ///
31 /// *Accessing raw data is extremely unsafe.*
32 /// It is recommended to use [`Consumer::as_slices`](`crate::Consumer::as_slices`) and [`Producer::free_space_as_slices`](`crate::Producer::free_space_as_slices`) instead.
33 unsafe fn slicesrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#slices().(
34 &self,
35 head: usize,
36 tail: usize,
37 ) -> (&mut [MaybeUninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/MaybeUninit#<T>], &mut [MaybeUninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/MaybeUninit#<T>]);
38
39 /// Capacity of the ring buffer.
40 ///
41 /// It is constant during the whole ring buffer lifetime.
42 fn capacity_nonzerorust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#capacity_nonzero().(&self) -> NonZeroUsizerust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/NonZeroUsize#;
43
44 /// Head position.
45 fn headrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#head().(&self) -> usize;
46
47 /// Tail position.
48 fn tailrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#tail().(&self) -> usize;
49
50 /// Modulus for `head` and `tail` values.
51 ///
52 /// Equals to `2 * len`.
53 #[inline]
54 fn modulusrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#modulus().(&self) -> NonZeroUsizerust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/NonZeroUsize# {
55 unsafe { NonZeroUsizerust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/NonZeroUsize#::new_uncheckedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[`NonZero<T>`]new_unchecked().(2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().self.capacity_nonzerorust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#capacity_nonzero().().getrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[`NonZero<T>`]get().()) }
56 }
57
58 /// The number of items stored in the buffer at the moment.
59 fn occupied_lenrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#occupied_len().(&self) -> usize {
60 let modulus = self.modulusrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#modulus().();
61 (modulus.getrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[`NonZero<T>`]get().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().self.tailrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#tail().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().self.headrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#head().()) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[usize][`Rem<NonZero<usize>>`]rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[usize][`Rem<NonZero<usize>>`]rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[usize][`Rem<NonZero<usize>>`]rem().modulus
62 }
63
64 /// The number of vacant places in the buffer at the moment.
65 fn vacant_lenrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#vacant_len().(&self) -> usize {
66 let modulus = self.modulusrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#modulus().();
67 (self.capacity_nonzerorust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#capacity_nonzero().().getrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[`NonZero<T>`]get().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().self.headrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#head().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().self.tailrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#tail().()) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[usize][`Rem<NonZero<usize>>`]rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[usize][`Rem<NonZero<usize>>`]rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[usize][`Rem<NonZero<usize>>`]rem().modulus
68 }
69
70 /// Checks if the occupied range is empty.
71 fn is_emptyrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#is_empty().(&self) -> bool {
72 self.headrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#head().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().self.tailrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#tail().()
73 }
74
75 /// Checks if the vacant range is empty.
76 fn is_fullrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#is_full().(&self) -> bool {
77 self.vacant_lenrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#vacant_len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0
78 }
79 }
80
81 /// Ring buffer read end.
82 ///
83 /// Provides access to occupied memory and mechanism of item extraction.
84 ///
85 /// *It is recommended not to use this trait directly. Use [`Producer`](`crate::Producer`) and [`Consumer`](`crate::Consumer`) instead.*
86 pub trait RbReadrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbRead#<T>: RbBaserust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#<T> {
87 /// Sets the new **head** position.
88 ///
89 /// # Safety
90 ///
91 /// This call must cohere with ring buffer data modification.
92 ///
93 /// It is recommended to use `Self::advance_head` instead.
94 unsafe fn set_headrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbRead#set_head().(&self, value: usize);
95
96 /// Move **head** position by `count` items forward.
97 ///
98 /// # Safety
99 ///
100 /// First `count` items in occupied area must be **initialized** before this call.
101 ///
102 /// *In debug mode panics if `count` is greater than number of items in the ring buffer.*
103 unsafe fn advance_headrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbRead#advance_head().(&self, count: usize) {
104 debug_assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/debug_assert!!(count <= self.occupied_lenrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#occupied_len().());
105 self.set_headrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbRead#set_head().((self.headrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#head().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().count) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[usize][`Rem<NonZero<usize>>`]rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[usize][`Rem<NonZero<usize>>`]rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[usize][`Rem<NonZero<usize>>`]rem().self.modulusrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#modulus().());
106 }
107
108 /// Returns a pair of ranges of [`Self::occupied_slices`] location in underlying container.
109 #[inline]
110 fn occupied_rangesrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbRead#occupied_ranges().(&self) -> (Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#<usize>, Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#<usize>) {
111 ring_buffer_rangesrust-analyzer cargo ringbuf 0.3.3 utils/ring_buffer_ranges().(self.capacity_nonzerorust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#capacity_nonzero().(), self.headrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#head().(), self.tailrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#tail().())
112 }
113
114 /// Provides a direct mutable access to the ring buffer occupied memory.
115 ///
116 /// Returns a pair of slices of stored items, the second one may be empty.
117 /// Elements with lower indices in slice are older. First slice contains older items that second one.
118 ///
119 /// # Safety
120 ///
121 /// All items are initialized. Elements must be removed starting from the beginning of first slice.
122 /// When all items are removed from the first slice then items must be removed from the beginning of the second slice.
123 ///
124 /// *This method must be followed by [`Self::advance_head`] call with the number of items being removed previously as argument.*
125 /// *No other mutating calls allowed before that.*
126 #[inline]
127 unsafe fn occupied_slicesrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbRead#occupied_slices().(&self) -> (&mut [MaybeUninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/MaybeUninit#<T>], &mut [MaybeUninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/MaybeUninit#<T>]) {
128 self.slicesrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#slices().(self.headrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#head().(), self.tailrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#tail().())
129 }
130
131 /// Removes items from the head of ring buffer and drops them.
132 ///
133 /// + If `count_or_all` is `Some(count)` then exactly `count` items will be removed.
134 /// *In debug mode panics if `count` is greater than number of items stored in the buffer.*
135 /// + If `count_or_all` is `None` then all items in ring buffer will be removed.
136 /// *If there is concurring producer activity then the buffer may be not empty after this call.*
137 ///
138 /// Returns the number of removed items.
139 ///
140 /// # Safety
141 ///
142 /// Must not be called concurrently.
143 unsafe fn skip_internalrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbRead#skip_internal().(&self, count_or_all: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<usize>) -> usize {
144 let (left, right) = self.occupied_slicesrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbRead#occupied_slices().();
145 let count = match count_or_all {
146 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(count) => {
147 debug_assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/debug_assert!!(count <= left.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). right.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().());
148 count
149 }
150 Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => left.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().right.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().(),
151 };
152 for elem in left.iter_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter_mut().().chainrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#chain().(right.iter_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter_mut().()).takerust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#take().(count) {
153 ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::drop_in_placerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/drop_in_place().(elem.as_mut_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/impl#[`MaybeUninit<T>`]as_mut_ptr().());
154 }
155 self.advance_headrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbRead#advance_head().(count);
156 count
157 }
158 }
159
160 /// Ring buffer write end.
161 ///
162 /// Provides access to vacant memory and mechanism of item insertion.
163 ///
164 /// *It is recommended not to use this trait directly. Use [`Producer`](`crate::Producer`) and [`Consumer`](`crate::Consumer`) instead.*
165 pub trait RbWriterust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbWrite#<T>: RbBaserust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#<T> {
166 /// Sets the new **tail** position.
167 ///
168 /// # Safety
169 ///
170 /// This call must cohere with ring buffer data modification.
171 ///
172 /// It is recommended to use `Self::advance_tail` instead.
173 unsafe fn set_tailrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbWrite#set_tail().(&self, value: usize);
174
175 /// Move **tail** position by `count` items forward.
176 ///
177 /// # Safety
178 ///
179 /// First `count` items in vacant area must be **de-initialized** (dropped) before this call.
180 ///
181 /// *In debug mode panics if `count` is greater than number of vacant places in the ring buffer.*
182 unsafe fn advance_tailrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbWrite#advance_tail().(&self, count: usize) {
183 debug_assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/debug_assert!!(count <= self.vacant_lenrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#vacant_len().());
184 self.set_tailrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbWrite#set_tail().((self.tailrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#tail().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().count) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[usize][`Rem<NonZero<usize>>`]rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[usize][`Rem<NonZero<usize>>`]rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[usize][`Rem<NonZero<usize>>`]rem().self.modulusrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#modulus().());
185 }
186
187 /// Returns a pair of ranges of [`Self::vacant_slices`] location in underlying container.
188 #[inline]
189 fn vacant_rangesrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbWrite#vacant_ranges().(&self) -> (Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#<usize>, Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#<usize>) {
190 ring_buffer_rangesrust-analyzer cargo ringbuf 0.3.3 utils/ring_buffer_ranges().(
191 self.capacity_nonzerorust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#capacity_nonzero().(),
192 self.tailrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#tail().(),
193 self.headrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#head().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().self.capacity_nonzerorust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#capacity_nonzero().().getrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[`NonZero<T>`]get().(),
194 )
195 }
196
197 /// Provides a direct access to the ring buffer vacant memory.
198 /// Returns a pair of slices of uninitialized memory, the second one may be empty.
199 ///
200 /// # Safety
201 ///
202 /// Vacant memory is uninitialized. Initialized items must be put starting from the beginning of first slice.
203 /// When first slice is fully filled then items must be put to the beginning of the second slice.
204 ///
205 /// *This method must be followed by [`Self::advance_tail`] call with the number of items being put previously as argument.*
206 /// *No other mutating calls allowed before that.*
207 #[inline]
208 unsafe fn vacant_slicesrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbWrite#vacant_slices().(&self) -> (&mut [MaybeUninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/MaybeUninit#<T>], &mut [MaybeUninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/MaybeUninit#<T>]) {
209 self.slicesrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#slices().(self.tailrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#tail().(), self.headrust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#head().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().self.capacity_nonzerorust-analyzer cargo ringbuf 0.3.3 ring_buffer/base/RbBase#capacity_nonzero().().getrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[`NonZero<T>`]get().())
210 }
211 }