pub struct ChunkedBuffer { /* private fields */ }Expand description
A mutable buffer for chunked source code, supporting efficient appending of text.
Implementations§
Source§impl ChunkedBuffer
impl ChunkedBuffer
Sourcepub fn new_with_url(url: impl Into<Option<Url>>) -> Self
pub fn new_with_url(url: impl Into<Option<Url>>) -> Self
Creates a new ChunkedBuffer with the specified URL.
Sourcepub fn snapshot(&self) -> ChunkedSource
pub fn snapshot(&self) -> ChunkedSource
Returns a read-only snapshot of the current buffer.
Trait Implementations§
Source§impl Clone for ChunkedBuffer
impl Clone for ChunkedBuffer
Source§fn clone(&self) -> ChunkedBuffer
fn clone(&self) -> ChunkedBuffer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChunkedBuffer
impl Debug for ChunkedBuffer
Source§impl Default for ChunkedBuffer
impl Default for ChunkedBuffer
Source§fn default() -> ChunkedBuffer
fn default() -> ChunkedBuffer
Returns the “default value” for a type. Read more
Source§impl Source for ChunkedBuffer
impl Source for ChunkedBuffer
Source§fn chunk_at(&self, offset: usize) -> TextChunk<'_>
fn chunk_at(&self, offset: usize) -> TextChunk<'_>
Returns a text chunk containing the specified offset.
Source§fn get_text_in(&self, range: Range<usize>) -> Cow<'_, str>
fn get_text_in(&self, range: Range<usize>) -> Cow<'_, str>
Get the text content at the specified range. Read more
Source§fn get_char_at(&self, offset: usize) -> Option<char>
fn get_char_at(&self, offset: usize) -> Option<char>
Get a single character at the specified offset. Read more
Source§fn get_text_from(&self, offset: usize) -> Cow<'_, str>
fn get_text_from(&self, offset: usize) -> Cow<'_, str>
Get the text from the current position to the end of the source. Read more
Source§fn find_char_from(&self, offset: usize, ch: char) -> Option<usize>
fn find_char_from(&self, offset: usize, ch: char) -> Option<usize>
Find the next occurrence of a character starting from an offset. Read more
Auto Trait Implementations§
impl Freeze for ChunkedBuffer
impl RefUnwindSafe for ChunkedBuffer
impl Send for ChunkedBuffer
impl Sync for ChunkedBuffer
impl Unpin for ChunkedBuffer
impl UnwindSafe for ChunkedBuffer
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