pub struct SectionSource {
pub trivia_before: Vec<Trivia>,
pub path: SourcePath,
pub body: SectionBody,
pub trailing_comment: Option<Comment>,
}Expand description
A section statement: @ path followed by body.
Mirrors grammar: Section: At Keys SectionBody ;
Fields§
§trivia_before: Vec<Trivia>Comments/blank lines before this section
path: SourcePathThe path (Keys)
body: SectionBodyThe section body (SectionBody)
trailing_comment: Option<Comment>Optional trailing comment (same line)
Implementations§
Source§impl SectionSource
impl SectionSource
Sourcepub fn items(
path: SourcePath,
value: Option<NodeId>,
bindings: Vec<BindingSource>,
) -> Self
pub fn items( path: SourcePath, value: Option<NodeId>, bindings: Vec<BindingSource>, ) -> Self
Create a section with items body: @ path (items follow)
Sourcepub fn block(path: SourcePath, source_id: SourceId) -> Self
pub fn block(path: SourcePath, source_id: SourceId) -> Self
Create a section with block body: @ path { eure }
Sourcepub fn with_trailing_comment(self, comment: Comment) -> Self
pub fn with_trailing_comment(self, comment: Comment) -> Self
Add a trailing comment.
Sourcepub fn with_trivia(self, trivia: Vec<Trivia>) -> Self
pub fn with_trivia(self, trivia: Vec<Trivia>) -> Self
Add trivia before this section.
Trait Implementations§
Source§impl Clone for SectionSource
impl Clone for SectionSource
Source§fn clone(&self) -> SectionSource
fn clone(&self) -> SectionSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SectionSource
impl RefUnwindSafe for SectionSource
impl Send for SectionSource
impl Sync for SectionSource
impl Unpin for SectionSource
impl UnwindSafe for SectionSource
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