Enum hcl::structure::BlockLabel
source · [−]pub enum BlockLabel {
Identifier(Identifier),
String(String),
}
Expand description
Represents an HCL block label.
In HCL syntax this can be represented either as a quoted string literal…
block_identifier "block_label1" {
body
}
…or as a bare identifier:
block_identifier block_label1 {
body
}
Variants
Identifier(Identifier)
A bare HCL block label.
String(String)
A quoted string literal.
Implementations
sourceimpl BlockLabel
impl BlockLabel
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 BlockLabel
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 BlockLabel
.
sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consumes self
and returns the String
wrapped by the BlockLabel
.
Beware that after calling .into_inner()
it is not possible anymore to tell whether the
String
resembles a quoted string or bare identifer.
Trait Implementations
sourceimpl Clone for BlockLabel
impl Clone for BlockLabel
sourcefn clone(&self) -> BlockLabel
fn clone(&self) -> BlockLabel
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for BlockLabel
impl Debug for BlockLabel
sourceimpl<'de> Deserialize<'de> for BlockLabel
impl<'de> Deserialize<'de> for BlockLabel
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<T> From<T> for BlockLabel where
T: Into<String>,
impl<T> From<T> for BlockLabel where
T: Into<String>,
sourcefn from(v: T) -> BlockLabel
fn from(v: T) -> BlockLabel
Converts to this type from the input type.
sourceimpl<'de> IntoDeserializer<'de, Error> for BlockLabel
impl<'de> IntoDeserializer<'de, Error> for BlockLabel
type Deserializer = BlockLabelDeserializer
type Deserializer = BlockLabelDeserializer
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.
sourceimpl PartialEq<BlockLabel> for BlockLabel
impl PartialEq<BlockLabel> for BlockLabel
sourcefn eq(&self, other: &BlockLabel) -> bool
fn eq(&self, other: &BlockLabel) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &BlockLabel) -> bool
fn ne(&self, other: &BlockLabel) -> bool
This method tests for !=
.
sourceimpl Serialize for BlockLabel
impl Serialize for BlockLabel
impl StructuralPartialEq for BlockLabel
Auto Trait Implementations
impl RefUnwindSafe for BlockLabel
impl Send for BlockLabel
impl Sync for BlockLabel
impl Unpin for BlockLabel
impl UnwindSafe for BlockLabel
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