1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (C) 2020-2021 Daniel Mueller <deso@posteo.net>
// SPDX-License-Identifier: GPL-3.0-or-later

mod iter;
mod ring;

/// An iterator over the elements of a `RingBuf`.
pub use iter::RingIter;
/// A mutable iterator over the elements of a `RingBuf`.
pub use iter::RingIterMut;
/// A ring buffer for arbitrary but default-initializable data.
pub use ring::RingBuf;


#[macro_export]
macro_rules! ring_buf [
  ($($x:expr), *) => {
    ::rbuf::RingBuf::from_vec(::std::vec![$($x),*])
  };
  ($($x:expr,) *) => {
    ::rbuf::RingBuf::from_vec(::std::vec![$($x),*])
  };
];