pub struct SegBuffer { /* private fields */ }Expand description
A segmented buffer that holds data in multiple segments.
The Buffer struct represents a buffer that is divided into multiple segments.
It contains the LineIndex and the internal representation of the segments.
Implementations§
Source§impl SegBuffer
impl SegBuffer
pub fn read_file( file: File, seg_count: NonZeroUsize, complete: bool, ) -> Result<Self>
pub fn read_stream(stream: BoxedStream, complete: bool) -> Result<Self>
Sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
Return the line count of this SegBuffer.
pub fn get_bytes(&self, line_number: usize) -> Option<SegBytes>
pub fn segment_iter(&self) -> Result<ContiguousSegmentIterator>
pub fn all_line_matches(&self) -> LineSet
pub fn write_to_file<W>(
&mut self,
output: &mut W,
lines: &LineSet,
) -> Result<()>where
W: Write,
pub fn write_to_string( &mut self, output: &mut String, lines: &LineSet, ) -> Result<()>
Auto Trait Implementations§
impl !Freeze for SegBuffer
impl !RefUnwindSafe for SegBuffer
impl Send for SegBuffer
impl !Sync for SegBuffer
impl Unpin for SegBuffer
impl UnwindSafe for SegBuffer
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