pub struct StructureMut<'a> { /* private fields */ }
Expand description
Allows mutable access to a structure, except for attribute keys which are immutable.
This type wraps the structure in the iterator returned by
Body::iter_mut
.
Implementations§
Source§impl<'a> StructureMut<'a>
impl<'a> StructureMut<'a>
Sourcepub fn is_attribute(&self) -> bool
pub fn is_attribute(&self) -> bool
Returns true
if the structure represents an Attribute
.
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<AttributeMut<'_>>
pub fn as_attribute_mut(&mut self) -> Option<AttributeMut<'_>>
If the Structure
is an Attribute
, returns a mutable reference to it, otherwise None
.
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§
Source§impl<'a> Decorate for StructureMut<'a>
impl<'a> Decorate for StructureMut<'a>
Auto Trait Implementations§
impl<'a> Freeze for StructureMut<'a>
impl<'a> RefUnwindSafe for StructureMut<'a>
impl<'a> Send for StructureMut<'a>
impl<'a> Sync for StructureMut<'a>
impl<'a> Unpin for StructureMut<'a>
impl<'a> !UnwindSafe for StructureMut<'a>
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