pub struct WriteFileGuard<'a, U: Ui> { /* private fields */ }Methods from Deref<Target = File>§
Sourcepub fn write(&mut self) -> Result<Option<usize>, Text>
pub fn write(&mut self) -> Result<Option<usize>, Text>
Writes the file to the current Path, if one was set
Sourcepub fn write_to(&self, path: impl AsRef<Path>) -> Result<Option<usize>>
pub fn write_to(&self, path: impl AsRef<Path>) -> Result<Option<usize>>
Writes the file to the given Path
Sourcepub fn path(&self) -> String
pub fn path(&self) -> String
The full path of the file.
If there is no set path, returns "*scratch file*#{id}".
Sourcepub fn path_set(&self) -> Option<String>
pub fn path_set(&self) -> Option<String>
The full path of the file.
Returns None if the path has not been set yet.
Sourcepub fn name(&self) -> String
pub fn name(&self) -> String
The file’s name.
If there is no set path, returns "*scratch file #{id}*".
Sourcepub fn name_set(&self) -> Option<String>
pub fn name_set(&self) -> Option<String>
The file’s name.
Returns None if the path has not been set yet.
pub fn path_kind(&self) -> PathKind
Sourcepub fn printed_lines(&self) -> &[(usize, bool)]
pub fn printed_lines(&self) -> &[(usize, bool)]
Returns the currently printed set of lines.
These are returned as a usize, showing the index of the line
in the file, and a bool, which is true when the line is
wrapped.
pub fn text_mut(&mut self) -> &mut Text
Sourcepub fn cursors_mut(&mut self) -> Option<&mut Cursors>
pub fn cursors_mut(&mut self) -> Option<&mut Cursors>
A mutable reference to the Cursors, if they exist
Trait Implementations§
Source§impl<U: Ui> Deref for WriteFileGuard<'_, U>
impl<U: Ui> Deref for WriteFileGuard<'_, U>
Source§impl<U: Ui> DerefMut for WriteFileGuard<'_, U>
impl<U: Ui> DerefMut for WriteFileGuard<'_, U>
Auto Trait Implementations§
impl<'a, U> Freeze for WriteFileGuard<'a, U>
impl<'a, U> !RefUnwindSafe for WriteFileGuard<'a, U>
impl<'a, U> !Send for WriteFileGuard<'a, U>
impl<'a, U> !Sync for WriteFileGuard<'a, U>
impl<'a, U> Unpin for WriteFileGuard<'a, U>
impl<'a, U> !UnwindSafe for WriteFileGuard<'a, U>
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