pub struct Buffer {
pub language: Option<String>,
pub fold_strategy: FoldStrategy,
pub read_only: bool,
pub meta: FileMeta,
/* private fields */
}Fields§
§language: Option<String>§fold_strategy: FoldStrategyHow fold regions are found; the app sets it from the language.
read_only: boolEdits are refused (a compare view’s copy of a file on disk).
meta: FileMetaImplementations§
Source§impl Buffer
impl Buffer
pub fn id(&self) -> BufferId
pub fn doc(&self) -> &Document
pub fn history(&self) -> &History
Sourcepub fn revision(&self) -> Revision
pub fn revision(&self) -> Revision
Identifies the current text state; returns to an earlier value on undo.
pub fn is_dirty(&self) -> bool
Sourcepub fn mark_saved(&mut self)
pub fn mark_saved(&mut self)
Records that the current state is what is on disk.
Sourcepub fn mark_saved_at(&mut self, revision: Revision)
pub fn mark_saved_at(&mut self, revision: Revision)
Records that revision is what is on disk (a background save of an
earlier state finished; the buffer stays dirty if it changed since).
Sourcepub fn mark_modified(&mut self)
pub fn mark_modified(&mut self)
Marks the buffer as differing from disk, e.g. when its text was restored from a backup snapshot.
Sourcepub fn take_line_edits(&mut self) -> Vec<LineEdit>
pub fn take_line_edits(&mut self) -> Vec<LineEdit>
How the lines changed since the last call, in the order the edits were applied (for incremental highlighting).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Buffer
impl RefUnwindSafe for Buffer
impl Send for Buffer
impl Sync for Buffer
impl Unpin for Buffer
impl UnsafeUnpin 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