pub struct ConstReadBuffer<'a> { /* private fields */ }Expand description
A buffer that can be read from at compile time.
This is very similar to std::io::Cursor, but it is designed to be used
in const contexts.
Implementations§
Source§impl<'a> ConstReadBuffer<'a>
impl<'a> ConstReadBuffer<'a>
Sourcepub const fn new(memory: &'a [u8]) -> ConstReadBuffer<'a>
pub const fn new(memory: &'a [u8]) -> ConstReadBuffer<'a>
Create a new buffer from a byte slice.
Sourcepub const fn get(self) -> Option<(ConstReadBuffer<'a>, u8)>
pub const fn get(self) -> Option<(ConstReadBuffer<'a>, u8)>
Get the next byte from the buffer.
Returns None if the buffer is empty. Otherwise this returns the new
buffer state along with the byte that was read.
Trait Implementations§
Source§impl<'a> Clone for ConstReadBuffer<'a>
impl<'a> Clone for ConstReadBuffer<'a>
Source§fn clone(&self) -> ConstReadBuffer<'a>
fn clone(&self) -> ConstReadBuffer<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for ConstReadBuffer<'a>
Source§impl<'a> Debug for ConstReadBuffer<'a>
impl<'a> Debug for ConstReadBuffer<'a>
Source§impl<'a> PartialEq for ConstReadBuffer<'a>
impl<'a> PartialEq for ConstReadBuffer<'a>
impl<'a> StructuralPartialEq for ConstReadBuffer<'a>
Auto Trait Implementations§
impl<'a> Freeze for ConstReadBuffer<'a>
impl<'a> RefUnwindSafe for ConstReadBuffer<'a>
impl<'a> Send for ConstReadBuffer<'a>
impl<'a> Sync for ConstReadBuffer<'a>
impl<'a> Unpin for ConstReadBuffer<'a>
impl<'a> UnsafeUnpin for ConstReadBuffer<'a>
impl<'a> UnwindSafe for ConstReadBuffer<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more