pub enum BlockBody {
Multiline(Body),
Oneline(Box<OnelineBody>),
}Expand description
Variants§
Multiline(Body)
A multiline block body with zero or more Structures.
Oneline(Box<OnelineBody>)
A oneline block body with zero or one Attributes.
Implementations§
source§impl BlockBody
impl BlockBody
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of structures in the block body, also referred to as its ‘length’.
sourcepub fn is_multiline(&self) -> bool
pub fn is_multiline(&self) -> bool
Returns true if this is a multiline block body.
sourcepub fn is_oneline(&self) -> bool
pub fn is_oneline(&self) -> bool
Returns true if this is a oneline block body.
sourcepub fn as_multiline(&self) -> Option<&Body>
pub fn as_multiline(&self) -> Option<&Body>
If the BlockBody is of variant Multiline, returns a reference to the Body,
otherwise None.
sourcepub fn as_multiline_mut(&mut self) -> Option<&mut Body>
pub fn as_multiline_mut(&mut self) -> Option<&mut Body>
If the BlockBody is of variant Multiline, returns a mutable reference to the Body,
otherwise None.
sourcepub fn as_oneline(&self) -> Option<&OnelineBody>
pub fn as_oneline(&self) -> Option<&OnelineBody>
If the BlockBody is of variant Oneline, returns a reference to the OnelineBody,
otherwise None.
sourcepub fn as_oneline_mut(&mut self) -> Option<&mut OnelineBody>
pub fn as_oneline_mut(&mut self) -> Option<&mut OnelineBody>
If the BlockBody is of variant Oneline, returns a mutable reference to the
OnelineBody, otherwise None.
Trait Implementations§
source§impl From<OnelineBody> for BlockBody
impl From<OnelineBody> for BlockBody
source§fn from(value: OnelineBody) -> Self
fn from(value: OnelineBody) -> Self
Converts to this type from the input type.
source§impl<T> FromIterator<T> for BlockBodywhere
T: Into<Structure>,
impl<T> FromIterator<T> for BlockBodywhere T: Into<Structure>,
source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> Selfwhere I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
source§impl<'a> IntoIterator for &'a BlockBody
impl<'a> IntoIterator for &'a BlockBody
source§impl<'a> IntoIterator for &'a mut BlockBody
impl<'a> IntoIterator for &'a mut BlockBody
source§impl IntoIterator for BlockBody
impl IntoIterator for BlockBody
source§impl PartialEq<BlockBody> for BlockBody
impl PartialEq<BlockBody> for BlockBody
impl Eq for BlockBody
impl StructuralEq for BlockBody
impl StructuralPartialEq for BlockBody
Auto Trait Implementations§
impl RefUnwindSafe for BlockBody
impl Send for BlockBody
impl Sync for BlockBody
impl Unpin for BlockBody
impl UnwindSafe for BlockBody
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