pub struct Attribute {
pub key: String,
pub expr: Expression,
}
Expand description
Represents an HCL attribute which consists of an attribute key and a value expression.
In HCL syntax this is represented as:
key = value
Use Attribute::new
to construct an Attribute
from a value that is convertible to this
crate’s Expression
type.
Fields
key: String
The HCL attribute’s key.
expr: Expression
The value expression of the HCL attribute.
Implementations
sourceimpl Attribute
impl Attribute
sourcepub fn new<K, V>(key: K, expr: V) -> Attribute where
K: Into<String>,
V: Into<Expression>,
pub fn new<K, V>(key: K, expr: V) -> Attribute where
K: Into<String>,
V: Into<Expression>,
Creates a new Attribute
from an attribute key that is convertible into a String
and an
attribute value that is convertible into an Expression
.
sourcepub fn expr(&self) -> &Expression
pub fn expr(&self) -> &Expression
Returns a reference to the attribute value expression.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Attribute
impl<'de> Deserialize<'de> for Attribute
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'de> IntoDeserializer<'de, Error> for Attribute
impl<'de> IntoDeserializer<'de, Error> for Attribute
type Deserializer = AttributeDeserializer
type Deserializer = AttributeDeserializer
The type of the deserializer being converted into.
sourcefn into_deserializer(self) -> Self::Deserializer
fn into_deserializer(self) -> Self::Deserializer
Convert this value into a deserializer.
impl StructuralPartialEq for Attribute
Auto Trait Implementations
impl RefUnwindSafe for Attribute
impl Send for Attribute
impl Sync for Attribute
impl Unpin for Attribute
impl UnwindSafe for Attribute
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more