pub struct BufferManager { /* private fields */ }
Expand description
Manages multiple buffers and switching between them
Implementations§
Source§impl BufferManager
impl BufferManager
pub fn new() -> Self
Sourcepub fn add_buffer(&mut self, buffer: Buffer) -> usize
pub fn add_buffer(&mut self, buffer: Buffer) -> usize
Add a new buffer and make it current
Sourcepub fn current_mut(&mut self) -> Option<&mut Buffer>
pub fn current_mut(&mut self) -> Option<&mut Buffer>
Get current buffer mutably
Sourcepub fn next_buffer(&mut self)
pub fn next_buffer(&mut self)
Switch to next buffer
Sourcepub fn prev_buffer(&mut self)
pub fn prev_buffer(&mut self)
Switch to previous buffer
Sourcepub fn close_current(&mut self) -> bool
pub fn close_current(&mut self) -> bool
Close current buffer
Sourcepub fn find_by_path(&self, path: &PathBuf) -> Option<usize>
pub fn find_by_path(&self, path: &PathBuf) -> Option<usize>
Find buffer by file path
Sourcepub fn all_buffers(&self) -> &[Buffer]
pub fn all_buffers(&self) -> &[Buffer]
Get all buffers for display
Sourcepub fn current_index(&self) -> usize
pub fn current_index(&self) -> usize
Get current buffer index
Sourcepub fn has_multiple(&self) -> bool
pub fn has_multiple(&self) -> bool
Check if we have multiple buffers
Auto Trait Implementations§
impl Freeze for BufferManager
impl !RefUnwindSafe for BufferManager
impl Send for BufferManager
impl Sync for BufferManager
impl Unpin for BufferManager
impl !UnwindSafe for BufferManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more