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(String)
A bare HCL block label.
StringLit(String)
A quoted string literal.
Implementations
sourceimpl BlockLabel
impl BlockLabel
sourcepub fn identifier<I>(identifier: I) -> Self where
I: Into<String>,
pub fn identifier<I>(identifier: I) -> Self where
I: Into<String>,
Creates a new bare BlockLabel identifier.
sourcepub fn string_lit<S>(string: S) -> Self where
S: Into<String>,
pub fn string_lit<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<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
Performs the conversion.
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 !=.
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more