pub struct File {
pub path: PathBuf,
pub section: FileSection,
}Expand description
Structure representing a file path and its content.
Fields§
§path: PathBufFile path.
section: FileSectionFile Section.
Implementations§
Methods from Deref<Target = FileSection>§
Sourcepub fn indented_branch(&mut self, name: impl Into<String>) -> &mut Self
pub fn indented_branch(&mut self, name: impl Into<String>) -> &mut Self
Gets or creates, if it doesn’t exist, an indented branch.
Sourcepub fn indexed_write<S: Into<String>>(&mut self, index: usize, content: S)
pub fn indexed_write<S: Into<String>>(&mut self, index: usize, content: S)
Writes the content to the file section at the specified index.
Sourcepub fn indexed_writeln<S: Into<String>>(&mut self, index: usize, content: S)
pub fn indexed_writeln<S: Into<String>>(&mut self, index: usize, content: S)
Writes the content to the file section at the specified index and adds a new line.
Sourcepub fn writeln<S: Into<String>>(&mut self, content: S)
pub fn writeln<S: Into<String>>(&mut self, content: S)
Writes the content to the file buffer and adds a new line.
Sourcepub fn indentation(&mut self, indentation_level: usize) -> &mut Self
pub fn indentation(&mut self, indentation_level: usize) -> &mut Self
Sets the indentation level.
Trait Implementations§
Source§impl AsMut<FileSection> for File
impl AsMut<FileSection> for File
Source§fn as_mut(&mut self) -> &mut FileSection
fn as_mut(&mut self) -> &mut FileSection
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRef<FileSection> for File
impl AsRef<FileSection> for File
Source§fn as_ref(&self) -> &FileSection
fn as_ref(&self) -> &FileSection
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Borrow<FileSection> for File
impl Borrow<FileSection> for File
Source§fn borrow(&self) -> &FileSection
fn borrow(&self) -> &FileSection
Immutably borrows from an owned value. Read more
Source§impl BorrowMut<FileSection> for File
impl BorrowMut<FileSection> for File
Source§fn borrow_mut(&mut self) -> &mut FileSection
fn borrow_mut(&mut self) -> &mut FileSection
Mutably borrows from an owned value. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for File
impl !Send for File
impl !Sync for File
impl !UnwindSafe for File
impl Freeze for File
impl Unpin for File
impl UnsafeUnpin for File
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
Source§impl<T> HasBranchesAPI for T
impl<T> HasBranchesAPI for T
Source§fn branches_impl2<T>(self) -> impl Iterator<Item = T>where
Self: Sized + HasBranches<T>,
fn branches_impl2<T>(self) -> impl Iterator<Item = T>where
Self: Sized + HasBranches<T>,
This is used internally. Should use
branches instead.Source§impl<'a, T> HasBranchesAPIV2<'a> for T
impl<'a, T> HasBranchesAPIV2<'a> for T
Source§fn branches<T>(&'a self) -> impl Iterator<Item = T>where
&'a Self: HasBranches<T>,
T: 'a,
fn branches<T>(&'a self) -> impl Iterator<Item = T>where
&'a Self: HasBranches<T>,
T: 'a,
Iterates over the branches of a type.
Source§fn branches_mut<T>(&'a mut self) -> impl Iterator<Item = T>where
&'a mut Self: HasBranches<T>,
T: 'a,
fn branches_mut<T>(&'a mut self) -> impl Iterator<Item = T>where
&'a mut Self: HasBranches<T>,
T: 'a,
Iterates over the branches of a type mutably.
fn all_branches<T>(&'a self) -> impl Iterator<Item = T>
fn all_branches_mut<T>(&'a mut self) -> impl Iterator<Item = T>
Source§impl<T> HasGet for T
impl<T> HasGet for T
Source§impl<'a, T> HasGetAPI<'a> for T
impl<'a, T> HasGetAPI<'a> for T
Source§impl<'a, T> HasRelative<'a> for T
impl<'a, T> HasRelative<'a> for T
Source§fn relative<K>(&'a self, path: impl IntoIterator<Item = K>) -> Option<Self>where
K: Into<String>,
Self: KnowsVisitor<Visitor = Self> + Clone + HasRoot + HasParent + HasPathSegment,
&'a Self: HasBranches<Self>,
fn relative<K>(&'a self, path: impl IntoIterator<Item = K>) -> Option<Self>where
K: Into<String>,
Self: KnowsVisitor<Visitor = Self> + Clone + HasRoot + HasParent + HasPathSegment,
&'a Self: HasBranches<Self>,
Gets a relative path.
“self”, “root”, and “super” are reserved path segments.
“self” is the current object, “root” is the root object, and “super” is the parent object.
Source§impl<'a, T> HasRelativeMut<'a> for T
impl<'a, T> HasRelativeMut<'a> for T
Source§unsafe fn relative_mut<K>(
&'a mut self,
path: impl IntoIterator<Item = K>,
) -> Option<Self>where
K: Into<String>,
Self: Sized + KnowsVisitor<VisitorMut = Self> + UnsafeClone + HasRootMut + HasParentMut + HasPathSegment,
&'a mut Self: HasBranches<Self>,
unsafe fn relative_mut<K>(
&'a mut self,
path: impl IntoIterator<Item = K>,
) -> Option<Self>where
K: Into<String>,
Self: Sized + KnowsVisitor<VisitorMut = Self> + UnsafeClone + HasRootMut + HasParentMut + HasPathSegment,
&'a mut Self: HasBranches<Self>,
Gets a relative path mutably.
“self”, “root”, and “super” are reserved path segments.
“self” is the current object, “root” is the root object, and “super” is the parent object.