Fields
rows: Vec<Row>
filename: Option<PathBuf>
Implementations
sourceimpl Document
impl Document
pub fn new(rows: Vec<Row>, filename: PathBuf) -> Self
pub fn new_empty(filename: PathBuf) -> Self
sourcepub fn swap_filename(filename: &Path) -> PathBuf
pub fn swap_filename(filename: &Path) -> PathBuf
Panics
This function will panic if the path contains a non UTF-8 character
sourcepub fn save_to_swap_file(&self) -> Result<(), Error>
pub fn save_to_swap_file(&self) -> Result<(), Error>
pub fn trim_trailing_spaces(&mut self)
pub fn get_row(&self, index: RowIndex) -> Option<&Row>
pub fn remove_row(&mut self, index: RowIndex) -> Row
pub fn row_lengths(&self) -> Vec<usize>
pub fn is_empty(&self) -> bool
pub fn num_rows(&self) -> usize
pub fn num_words(&self) -> usize
sourcepub fn row_for_line_number(&self, line_number: LineNumber) -> Option<&Row>
pub fn row_for_line_number(&self, line_number: LineNumber) -> Option<&Row>
Get the document row corresponding to a given line number
sourcepub fn last_line_number(&self) -> LineNumber
pub fn last_line_number(&self) -> LineNumber
Return the line number of the last line in the file
pub fn iter(&self) -> Iter<'_, Row>
pub fn iter_mut(&mut self) -> IterMut<'_, Row>
pub fn insert_string(&mut self, text: &str, x: usize, y: RowIndex)
pub fn insert_newline(&mut self, x: usize, y: RowIndex)
pub fn insert(&mut self, c: char, x: usize, y: RowIndex)
pub fn delete_string(&mut self, text: &str, x: usize, y: RowIndex)
pub fn delete(&mut self, x: usize, from_x: usize, y: RowIndex)
pub fn delete_row(&mut self, index: RowIndex)
pub fn join_row_with_previous_one(
&mut self,
x: usize,
y: RowIndex,
join_with: Option<char>
)
pub fn hashed(&self) -> u64
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more