pub struct FormatElement { /* private fields */ }Expand description
A formattable element.
Implementations§
Source§impl FormatElement
impl FormatElement
Sourcepub fn new(
element: Element,
children: Option<NonEmpty<Box<FormatElement>>>,
) -> Self
pub fn new( element: Element, children: Option<NonEmpty<Box<FormatElement>>>, ) -> Self
Creates a new FormatElement.
Sourcepub fn children(
&self,
) -> Option<AssertConsumedIter<impl Iterator<Item = &FormatElement>>>
pub fn children( &self, ) -> Option<AssertConsumedIter<impl Iterator<Item = &FormatElement>>>
Gets the children for this node.
Sourcepub fn has_comment(&self) -> bool
pub fn has_comment(&self) -> bool
Returns true if the underlying syntax for element contains a comment
token (in case of a node) or has inline or preceding trivia (in case of
a token).
FormatElement collation drops trivia, so this peeks at the raw syntax
instead.
Trait Implementations§
Source§impl Clone for FormatElement
impl Clone for FormatElement
Source§fn clone(&self) -> FormatElement
fn clone(&self) -> FormatElement
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 FormatElement
impl Debug for FormatElement
Source§impl Writable for &FormatElement
impl Writable for &FormatElement
Auto Trait Implementations§
impl !RefUnwindSafe for FormatElement
impl !Send for FormatElement
impl !Sync for FormatElement
impl !UnwindSafe for FormatElement
impl Freeze for FormatElement
impl Unpin for FormatElement
impl UnsafeUnpin for FormatElement
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