pub struct Buffer { /* private fields */ }Implementations§
source§impl Buffer
impl Buffer
pub fn new_unnamed(id: usize, content: &str) -> Self
pub fn new_virtual(id: usize, name: String, content: String) -> Self
sourcepub fn display_name(&self, cwd: &Path) -> String
pub fn display_name(&self, cwd: &Path) -> String
Short name for displaying in the status line
pub fn dir(&self) -> Option<&Path>
pub fn is_unnamed(&self) -> bool
pub fn contents(&self) -> Vec<u8> ⓘ
pub fn str_contents(&self) -> String
pub fn dot_contents(&self) -> String
pub fn addr(&self) -> String
pub fn xdot_contents(&self) -> String
pub fn xaddr(&self) -> String
pub fn len_lines(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clamp_scroll(&mut self, screen_rows: usize, screen_cols: usize)
pub fn view_port( &mut self, vp: ViewPort, screen_rows: usize, screen_cols: usize, )
pub fn line(&self, y: usize) -> Option<Slice<'_>>
Trait Implementations§
source§impl Address for Buffer
impl Address for Buffer
source§fn current_dot(&self) -> Dot
fn current_dot(&self) -> Dot
This only really makes sense for use with a buffer but is supported
so that don’t need to special case running programs against an in-editor
buffer vs stdin or a file read from disk.
fn len_chars(&self) -> usize
fn line_to_char(&self, line_idx: usize) -> Option<usize>
fn char_to_line(&self, char_idx: usize) -> Option<usize>
fn char_to_line_end(&self, char_idx: usize) -> Option<usize>
fn char_to_line_start(&self, char_idx: usize) -> Option<usize>
fn max_iter(&self) -> usize
fn map_addr(&self, a: &mut Addr) -> Dot
fn full_line(&self, line_idx: usize) -> Option<Dot>
fn map_simple_addr(&self, addr: &mut SimpleAddr, cur_dot: Dot) -> Option<Dot>
fn map_compound_addr( &self, from: &mut SimpleAddr, to: &mut SimpleAddr, ) -> Option<Dot>
source§impl IterBoundedChars for Buffer
impl IterBoundedChars for Buffer
impl Eq for Buffer
impl StructuralPartialEq for Buffer
Auto Trait Implementations§
impl !Freeze for Buffer
impl !RefUnwindSafe for Buffer
impl !Send for Buffer
impl !Sync for Buffer
impl Unpin for Buffer
impl UnwindSafe for Buffer
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)