pub enum Structure {
Attribute(Attribute),
Block(Block),
}
Expand description
Variants§
Implementations§
Source§impl Structure
impl Structure
Sourcepub fn is_attribute(&self) -> bool
pub fn is_attribute(&self) -> bool
Returns true
if the structure represents an Attribute
.
Sourcepub fn into_attribute(self) -> Result<Attribute, Structure>
pub fn into_attribute(self) -> Result<Attribute, Structure>
Sourcepub fn as_attribute(&self) -> Option<&Attribute>
pub fn as_attribute(&self) -> Option<&Attribute>
If the Structure
is an Attribute
, returns a reference to it, otherwise None
.
Sourcepub fn as_attribute_mut(&mut self) -> Option<&mut Attribute>
pub fn as_attribute_mut(&mut self) -> Option<&mut Attribute>
If the Structure
is an Attribute
, returns a mutable reference to it, otherwise None
.
Sourcepub fn into_block(self) -> Result<Block, Structure>
pub fn into_block(self) -> Result<Block, Structure>
Sourcepub fn as_block(&self) -> Option<&Block>
pub fn as_block(&self) -> Option<&Block>
If the Structure
is a Block
, returns a reference to it, otherwise None
.
Sourcepub fn as_block_mut(&mut self) -> Option<&mut Block>
pub fn as_block_mut(&mut self) -> Option<&mut Block>
If the Structure
is a Block
, returns a mutable reference to it, otherwise None
.
Trait Implementations§
impl Eq for Structure
impl StructuralPartialEq for Structure
Auto Trait Implementations§
impl Freeze for Structure
impl RefUnwindSafe for Structure
impl Send for Structure
impl Sync for Structure
impl Unpin for Structure
impl UnwindSafe for Structure
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