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> Deref for TreeEditor<'_, P>
impl<P: Marshallable> Deref for TreeEditor<'_, P>
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> !RefUnwindSafe for TreeEditor<'a, P>
impl<'a, P> !Send for TreeEditor<'a, P>
impl<'a, P> !Sync for TreeEditor<'a, P>
impl<'a, P> !UnwindSafe for TreeEditor<'a, P>
impl<'a, P> Freeze for TreeEditor<'a, P>
impl<'a, P> Unpin for TreeEditor<'a, P>
impl<'a, P> UnsafeUnpin for TreeEditor<'a, P>where
Option<P>: UnsafeUnpin,
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.
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
impl<R> CryptoRng for R
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<R> RngCore for Rwhere
R: Rng,
Source§impl<R> RngExt for R
impl<R> RngExt for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Return a random value via the
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more