pub struct ShiftBuffer<T> { /* private fields */ }Implementations§
Source§impl<T: Default + Copy> ShiftBuffer<T>
impl<T: Default + Copy> ShiftBuffer<T>
pub fn new(init_size: usize) -> Self
Sourcepub fn make_room(&mut self) -> &mut [T]
pub fn make_room(&mut self) -> &mut [T]
Make room in the buffer for more data.
If the upper end of the window is not at the stop position of the internal buffer, this method has no effect on the state of the buffer.
Otherwise, it performs either of two operations: if the lower end is at the beginning of the buffer (the window covers the entire buffer), the buffer is extended. Otherwise, the buffer is shifted; i.e., all entries prior to the lower end are discarded and the content is moved to the beginning of the buffer.
In all cases, the return value of this method is the same as for ShiftBuffer::free.
pub fn shift(&mut self)
pub fn free(&mut self) -> &mut [T]
pub fn lower(&self) -> Pointer
pub fn upper(&self) -> Pointer
pub fn relative_pos(&self, p: Pointer) -> usize
Sourcepub fn clone_window(&self) -> ShiftBuffer<T>
pub fn clone_window(&self) -> ShiftBuffer<T>
Create a shift buffer that contains a copy of the current window.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ShiftBuffer<T>
impl<T> RefUnwindSafe for ShiftBuffer<T>where
T: RefUnwindSafe,
impl<T> Send for ShiftBuffer<T>where
T: Send,
impl<T> Sync for ShiftBuffer<T>where
T: Sync,
impl<T> Unpin for ShiftBuffer<T>where
T: Unpin,
impl<T> UnsafeUnpin for ShiftBuffer<T>
impl<T> UnwindSafe for ShiftBuffer<T>where
T: UnwindSafe,
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