pub struct BindingSource {
pub trivia_before: Vec<Trivia>,
pub path: SourcePath,
pub bind: BindSource,
pub trailing_comment: Option<Comment>,
}Expand description
A binding statement: path followed by value or block.
Mirrors grammar: Binding: Keys BindingRhs ;
Fields§
§trivia_before: Vec<Trivia>Comments/blank lines before this binding
path: SourcePathThe path (Keys)
bind: BindSourceThe binding body (BindingRhs)
trailing_comment: Option<Comment>Optional trailing comment (same line)
Implementations§
Source§impl BindingSource
impl BindingSource
Sourcepub fn value(path: SourcePath, node: NodeId) -> Self
pub fn value(path: SourcePath, node: NodeId) -> Self
Create a value binding: path = value
Sourcepub fn block(path: SourcePath, source_id: SourceId) -> Self
pub fn block(path: SourcePath, source_id: SourceId) -> Self
Create a block binding: 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 binding.
Sourcepub fn array(
path: SourcePath,
node: NodeId,
elements: Vec<ArrayElementSource>,
) -> Self
pub fn array( path: SourcePath, node: NodeId, elements: Vec<ArrayElementSource>, ) -> Self
Create an array binding with per-element layout: path = [...]
Trait Implementations§
Source§impl Clone for BindingSource
impl Clone for BindingSource
Source§fn clone(&self) -> BindingSource
fn clone(&self) -> BindingSource
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 BindingSource
impl RefUnwindSafe for BindingSource
impl Send for BindingSource
impl Sync for BindingSource
impl Unpin for BindingSource
impl UnwindSafe for BindingSource
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