pub struct Buffer { /* private fields */ }Expand description
Internal state for a text buffer backed by a file on disk
Implementations§
Source§impl Buffer
impl Buffer
Sourcepub fn new_unnamed(id: usize, content: &str) -> Self
pub fn new_unnamed(id: usize, content: &str) -> Self
Create a new unnamed buffer with the given content
Sourcepub fn new_virtual(
id: usize,
name: impl Into<String>,
content: impl Into<String>,
) -> Self
pub fn new_virtual( id: usize, name: impl Into<String>, content: impl Into<String>, ) -> Self
Create a new virtual buffer with the given name and content.
The buffer will not be included in the virtual filesystem and it will be removed when it loses focus.
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
Short name for displaying in the status line
Sourcepub fn dir(&self) -> Option<&Path>
pub fn dir(&self) -> Option<&Path>
The directory containing the file backing this buffer so long as it has kind File.
Sourcepub fn output_file_key(&self, cwd: &Path) -> String
pub fn output_file_key(&self, cwd: &Path) -> String
The key for the +output buffer that output from command run from this buffer should be redirected to
Sourcepub fn is_unnamed(&self) -> bool
pub fn is_unnamed(&self) -> bool
Check whether or not this is an unnamed buffer
Sourcepub fn str_contents(&self) -> String
pub fn str_contents(&self) -> String
The utf-8 string contents of this buffer
Sourcepub fn dot_contents(&self) -> String
pub fn dot_contents(&self) -> String
The contents of the current Dot.
Sourcepub fn xdot_contents(&self) -> String
pub fn xdot_contents(&self) -> String
The contents of the current xdot.
This is a virtual dot that is only made use of through the filesystem interface.
Sourcepub fn xaddr(&self) -> String
pub fn xaddr(&self) -> String
The address of the current xdot.
This is a virtual dot that is only made use of through the filesystem interface.