pub struct Block {
pub identifier: Identifier,
pub labels: Vec<BlockLabel>,
pub body: Body,
}Expand description
Represents an HCL block which consists of a block identifier, zero or more block labels and a block body.
In HCL syntax this is represented as:
block_identifier "block_label1" "block_label2" {
body
}Fields§
§identifier: IdentifierThe block identifier.
labels: Vec<BlockLabel>Zero or more block labels.
body: BodyRepresents the Block’s body.
Implementations§
Source§impl Block
impl Block
Sourcepub fn new<I>(ident: I) -> Blockwhere
I: Into<Identifier>,
pub fn new<I>(ident: I) -> Blockwhere
I: Into<Identifier>,
Creates a new empty Block.
Sourcepub fn builder<I>(identifier: I) -> BlockBuilderwhere
I: Into<Identifier>,
pub fn builder<I>(identifier: I) -> BlockBuilderwhere
I: Into<Identifier>,
Creates a new BlockBuilder to start building a new Block with the provided
identifier.
Sourcepub fn identifier(&self) -> &str
pub fn identifier(&self) -> &str
Returns a reference to the block’s identifier.
Sourcepub fn labels(&self) -> &[BlockLabel]
pub fn labels(&self) -> &[BlockLabel]
Returns a reference to the block’s labels.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Block
impl<'de> Deserialize<'de> for Block
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Block, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Block, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Block
Source§impl Evaluate for Block
impl Evaluate for Block
Source§impl Format for Block
impl Format for Block
Source§fn format<W>(&self, fmt: &mut Formatter<'_, W>) -> Result<(), Error>where
W: Write,
fn format<W>(&self, fmt: &mut Formatter<'_, W>) -> Result<(), Error>where
W: Write,
Formats a HCL structure using a formatter and writes the result to the provided writer. Read more
Source§impl<I, L, B> From<(I, L, B)> for Blockwhere
I: Into<Identifier>,
L: IntoIterator,
<L as IntoIterator>::Item: Into<BlockLabel>,
B: IntoIterator,
<B as IntoIterator>::Item: Into<Structure>,
impl<I, L, B> From<(I, L, B)> for Blockwhere
I: Into<Identifier>,
L: IntoIterator,
<L as IntoIterator>::Item: Into<BlockLabel>,
B: IntoIterator,
<B as IntoIterator>::Item: Into<Structure>,
Source§impl<'de> IntoDeserializer<'de, Error> for Block
impl<'de> IntoDeserializer<'de, Error> for Block
Source§type Deserializer = MapAccessDeserializer<BlockAccess>
type Deserializer = MapAccessDeserializer<BlockAccess>
The type of the deserializer being converted into.
Source§fn into_deserializer(
self,
) -> <Block as IntoDeserializer<'de, Error>>::Deserializer
fn into_deserializer( self, ) -> <Block as IntoDeserializer<'de, Error>>::Deserializer
Convert this value into a deserializer.
Source§impl Serialize for Block
impl Serialize for Block
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Block
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnsafeUnpin for Block
impl UnwindSafe for Block
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.