Struct hcl_edit::structure::OnelineBody
source · pub struct OnelineBody { /* private fields */ }Expand description
Represents a oneline HCL block body containing zero or one Attributes.
Implementations§
source§impl OnelineBody
impl OnelineBody
sourcepub fn new() -> OnelineBody
pub fn new() -> OnelineBody
Creates a new empty OnelineBody.
sourcepub fn set_attribute(&mut self, attr: impl Into<Attribute>)
pub fn set_attribute(&mut self, attr: impl Into<Attribute>)
Sets the optional Attribute within the online block body.
sourcepub fn as_attribute(&self) -> Option<&Attribute>
pub fn as_attribute(&self) -> Option<&Attribute>
If the OnelineBody contains 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 OnelineBody contains an Attribute, returns a mutable reference to it, otherwise
None.
sourcepub fn trailing(&self) -> &RawString
pub fn trailing(&self) -> &RawString
Return a reference to raw trailing decor before the block’s closing }.
sourcepub fn set_trailing(&mut self, trailing: impl Into<RawString>)
pub fn set_trailing(&mut self, trailing: impl Into<RawString>)
Set the raw trailing decor before the block’s closing }.
Trait Implementations§
source§impl Clone for OnelineBody
impl Clone for OnelineBody
source§fn clone(&self) -> OnelineBody
fn clone(&self) -> OnelineBody
Returns a copy of the value. Read more
1.0.0 · 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 OnelineBody
impl Debug for OnelineBody
source§impl Default for OnelineBody
impl Default for OnelineBody
source§fn default() -> OnelineBody
fn default() -> OnelineBody
Returns the “default value” for a type. Read more
source§impl From<Attribute> for OnelineBody
impl From<Attribute> for OnelineBody
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 PartialEq<OnelineBody> for OnelineBody
impl PartialEq<OnelineBody> for OnelineBody
source§fn eq(&self, other: &OnelineBody) -> bool
fn eq(&self, other: &OnelineBody) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for OnelineBody
impl StructuralEq for OnelineBody
impl StructuralPartialEq for OnelineBody
Auto Trait Implementations§
impl RefUnwindSafe for OnelineBody
impl Send for OnelineBody
impl Sync for OnelineBody
impl Unpin for OnelineBody
impl UnwindSafe for OnelineBody
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