pub struct ArrayElementSource {
pub trivia_before: Vec<Trivia>,
pub index: usize,
pub trailing_comment: Option<Comment>,
}Expand description
Layout information for an array element.
Used to preserve comments that appear before array elements when converting from formats like TOML.
Fields§
§trivia_before: Vec<Trivia>Trivia (comments/blank lines) before this element
index: usizeThe index of this element in the NodeArray
trailing_comment: Option<Comment>Trailing comment on the same line as this element
Implementations§
Source§impl ArrayElementSource
impl ArrayElementSource
Sourcepub fn with_trivia(self, trivia: Vec<Trivia>) -> Self
pub fn with_trivia(self, trivia: Vec<Trivia>) -> Self
Add trivia before this element.
Sourcepub fn with_trailing_comment(self, comment: Comment) -> Self
pub fn with_trailing_comment(self, comment: Comment) -> Self
Add a trailing comment.
Trait Implementations§
Source§impl Clone for ArrayElementSource
impl Clone for ArrayElementSource
Source§fn clone(&self) -> ArrayElementSource
fn clone(&self) -> ArrayElementSource
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 moreSource§impl Debug for ArrayElementSource
impl Debug for ArrayElementSource
Source§impl PartialEq for ArrayElementSource
impl PartialEq for ArrayElementSource
impl Eq for ArrayElementSource
impl StructuralPartialEq for ArrayElementSource
Auto Trait Implementations§
impl Freeze for ArrayElementSource
impl RefUnwindSafe for ArrayElementSource
impl Send for ArrayElementSource
impl Sync for ArrayElementSource
impl Unpin for ArrayElementSource
impl UnwindSafe for ArrayElementSource
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.