#[non_exhaustive]
pub enum ObjectKey {
Identifier(Identifier),
String(String),
RawExpression(RawExpression),
}
Expand description
Represents an object key.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Identifier(Identifier)
Represents a bare unquoted identifer used as object key.
String(String)
Represents a quoted string used as object key.
RawExpression(RawExpression)
Represents a raw HCL expression. This includes any expression kind that does match any of
the enum variants above. See RawExpression
for more details.
Implementations
sourceimpl ObjectKey
impl ObjectKey
sourcepub fn identifier<I>(identifier: I) -> Self where
I: Into<Identifier>,
pub fn identifier<I>(identifier: I) -> Self where
I: Into<Identifier>,
Creates a new bare ObjectKey
identifier.
sourcepub fn string<S>(string: S) -> Self where
S: Into<String>,
pub fn string<S>(string: S) -> Self where
S: Into<String>,
Creates a new quoted string ObjectKey
.
sourcepub fn raw_expression<E>(expr: E) -> Self where
E: Into<RawExpression>,
pub fn raw_expression<E>(expr: E) -> Self where
E: Into<RawExpression>,
Creates a new raw expression ObjectKey
.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for ObjectKey
impl<'de> Deserialize<'de> for ObjectKey
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 ObjectKey
impl<'de> IntoDeserializer<'de, Error> for ObjectKey
type Deserializer = ObjectKeyDeserializer
type Deserializer = ObjectKeyDeserializer
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 Eq for ObjectKey
impl StructuralEq for ObjectKey
impl StructuralPartialEq for ObjectKey
Auto Trait Implementations
impl RefUnwindSafe for ObjectKey
impl Send for ObjectKey
impl Sync for ObjectKey
impl Unpin for ObjectKey
impl UnwindSafe for ObjectKey
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
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.