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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)