Lines Matching refs:storage

8 use crate::storage::Resettable;
28 storage: ManagedSlice<'a, T>, field
37 pub fn new<S>(storage: S) -> RingBuffer<'a, T> in new()
42 storage: storage.into(), in new()
56 self.storage.len() in capacity()
65 for elem in self.storage.iter_mut() { in reset()
128 let res = f(&mut self.storage[index]); in enqueue_one_with()
154 let res = f(&mut self.storage[self.read_at]); in dequeue_one_with()
193 let (size, result) = f(&mut self.storage[write_at..write_at + max_size]); in enqueue_many_with()
245 let (size, result) = f(&mut self.storage[self.read_at..self.read_at + max_size]); in dequeue_many_with()
314 &mut self.storage[start_at..start_at + size] in get_unallocated()
369 &self.storage[start_at..start_at + size] in get_allocated()
513 assert_eq!(&ring.storage[..], b"ab.........."); in test_buffer_enqueue_many_with()
521 assert_eq!(&ring.storage[..], b"abcdXX......"); in test_buffer_enqueue_many_with()
529 assert_eq!(&ring.storage[..], b"abcdefgh...."); in test_buffer_enqueue_many_with()
535 assert_eq!(&ring.storage[..], b"....efgh...."); in test_buffer_enqueue_many_with()
543 assert_eq!(&ring.storage[..], b"....efghijkl"); in test_buffer_enqueue_many_with()
551 assert_eq!(&ring.storage[..], b"abcdefghijkl"); in test_buffer_enqueue_many_with()
557 assert_eq!(&ring.storage[..], b"abcd....ijkl"); in test_buffer_enqueue_many_with()
566 assert_eq!(&ring.storage[..], b"abcdefgh...."); in test_buffer_enqueue_many()
570 assert_eq!(&ring.storage[..], b"abcdefghijkl"); in test_buffer_enqueue_many()
579 assert_eq!(&ring.storage[..], b"abcdefgh...."); in test_buffer_enqueue_slice()
585 assert_eq!(&ring.storage[..], b"....efgh...."); in test_buffer_enqueue_slice()
589 assert_eq!(&ring.storage[..], b"abcdefghijkl"); in test_buffer_enqueue_slice()
608 assert_eq!(&ring.storage[..], b"....efghijkl"); in test_buffer_dequeue_many_with()
616 assert_eq!(&ring.storage[..], b"........ijkl"); in test_buffer_dequeue_many_with()
632 assert_eq!(&ring.storage[..], b"............"); in test_buffer_dequeue_many_with()
647 assert_eq!(&ring.storage[..], b"........ijkl"); in test_buffer_dequeue_many()
655 assert_eq!(&ring.storage[..], b"............"); in test_buffer_dequeue_many()
691 assert_eq!(&ring.storage[..], b"abcd........"); in test_buffer_get_unallocated()
701 assert_eq!(&ring.storage[..], b"abcd....ijkl"); in test_buffer_get_unallocated()
706 assert_eq!(&ring.storage[..], b"abcdEFGHIJKL"); in test_buffer_get_unallocated()
712 assert_eq!(&ring.storage[..], b"ABCDEFGHIJKL"); in test_buffer_get_unallocated()