pub struct TreeEditor<'a, P: Marshallable> { /* private fields */ }Expand description
An editor for a file in a breezy tree
Implementations§
Source§impl<'a, P: Marshallable> TreeEditor<'a, P>
impl<'a, P: Marshallable> TreeEditor<'a, P>
Sourcepub fn from_env(
tree: &'a dyn MutableTree,
path: &Path,
allow_generated: bool,
allow_reformatting: Option<bool>,
) -> Result<Self, EditorError>
pub fn from_env( tree: &'a dyn MutableTree, path: &Path, allow_generated: bool, allow_reformatting: Option<bool>, ) -> Result<Self, EditorError>
Create a new editor, with preferences being read from the environment
Sourcepub fn new(
tree: &'a dyn MutableTree,
path: &Path,
allow_generated: bool,
allow_reformatting: bool,
) -> Result<Self, EditorError>
pub fn new( tree: &'a dyn MutableTree, path: &Path, allow_generated: bool, allow_reformatting: bool, ) -> Result<Self, EditorError>
Create a new editor
Trait Implementations§
Source§impl<P: Marshallable> DerefMut for TreeEditor<'_, P>
impl<P: Marshallable> DerefMut for TreeEditor<'_, P>
Source§impl<P: Marshallable> Editor<P> for TreeEditor<'_, P>
impl<P: Marshallable> Editor<P> for TreeEditor<'_, P>
Source§fn orig_content(&self) -> Option<&[u8]>
fn orig_content(&self) -> Option<&[u8]>
The original content, if any - without reformatting
Source§fn rewritten_content(&self) -> Option<&[u8]>
fn rewritten_content(&self) -> Option<&[u8]>
The original content, but rewritten with our parser/serializer
Source§fn is_generated(&self) -> bool
fn is_generated(&self) -> bool
Check if the file is generated
Source§fn has_changed(&self) -> bool
fn has_changed(&self) -> bool
Whether the file has changed
Auto Trait Implementations§
impl<'a, P> Freeze for TreeEditor<'a, P>where
P: Freeze,
impl<'a, P> !RefUnwindSafe for TreeEditor<'a, P>
impl<'a, P> !Send for TreeEditor<'a, P>
impl<'a, P> !Sync for TreeEditor<'a, P>
impl<'a, P> Unpin for TreeEditor<'a, P>where
P: Unpin,
impl<'a, P> !UnwindSafe for TreeEditor<'a, P>
Blanket Implementations§
Source§impl<E> AbstractControlEditor for E
impl<E> AbstractControlEditor for E
Source§fn source<'a>(&'a mut self) -> Option<Box<dyn AbstractSource<'a> + 'a>>
fn source<'a>(&'a mut self) -> Option<Box<dyn AbstractSource<'a> + 'a>>
Get the source package.
Source§fn wrap_and_sort(&mut self)
fn wrap_and_sort(&mut self)
Wrap and sort the control file.
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more