mod read;
mod write;

pub use read::*;
pub use write::*;

/// A snapshot of the cursor position within a buffer.
///
/// Snapshots are obtained through calls to [`ReadBuffer::snapshot`] or [`WriteBuffer::snapshot`].
/// Feeding a snapshot into [`ReadBuffer::restore`] or [`WriteBuffer::restore`] will consume it and restore the respective buffer cursor to the position recorded into the snapshot.
///
/// Users must guarantee the the restore methods are provided with snapshots originating from the same buffers.
/// Additionally, users must guarantee that buffers are not restored with snapshots pointing beyond the current cursor position.
pub struct Snapshot(usize);

#[cfg(test)]
mod tests;
