Struct hcl::expr::RawExpression

source ·
pub struct RawExpression(/* private fields */);
👎Deprecated since 0.16.3: Support for raw expressions will be removed in an upcoming release
Expand description

A type that holds the value of a raw expression. It can be used to serialize arbitrary HCL expressions.

Please note: raw expressions are not validated during serialization, so it is your responsiblity to ensure that they are valid HCL.

Implementations§

source§

impl RawExpression

source

pub fn new<E>(expr: E) -> RawExpression
where E: Into<String>,

Creates a new RawExpression from something that can be converted to a String.

source

pub fn into_inner(self) -> String

Consumes self and returns the RawExpression as a String. If you want to represent the RawExpression as an interpolated string, use .to_string() instead.

source

pub fn as_str(&self) -> &str

Returns the RawExpression as a &str. If you want to represent the RawExpression as an interpolated string, use .to_string() instead.

Trait Implementations§

source§

impl Clone for RawExpression

source§

fn clone(&self) -> RawExpression

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RawExpression

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for RawExpression

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for RawExpression

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Format for RawExpression

source§

fn format<W>(&self, fmt: &mut Formatter<'_, W>) -> Result<()>
where W: Write,

Formats a HCL structure using a formatter and writes the result to the provided writer. Read more
source§

fn format_vec<W>(&self, fmt: &mut Formatter<'_, W>) -> Result<Vec<u8>>
where W: Write + AsMut<Vec<u8>>,

Formats a HCL structure using a formatter and returns the result as a Vec<u8>. Read more
source§

fn format_string<W>(&self, fmt: &mut Formatter<'_, W>) -> Result<String>
where W: Write + AsMut<Vec<u8>>,

Formats a HCL structure using a formatter and returns the result as a String. Read more
source§

impl From<&str> for RawExpression

source§

fn from(expr: &str) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Cow<'a, str>> for RawExpression

source§

fn from(expr: Cow<'a, str>) -> Self

Converts to this type from the input type.
source§

impl From<RawExpression> for Expression

source§

fn from(raw: RawExpression) -> Self

Converts to this type from the input type.
source§

impl From<RawExpression> for String

source§

fn from(expr: RawExpression) -> Self

Converts to this type from the input type.
source§

impl From<String> for RawExpression

source§

fn from(expr: String) -> Self

Converts to this type from the input type.
source§

impl Hash for RawExpression

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'de> IntoDeserializer<'de, Error> for RawExpression

§

type Deserializer = StringDeserializer<Error>

The type of the deserializer being converted into.
source§

fn into_deserializer(self) -> Self::Deserializer

Convert this value into a deserializer.
source§

impl PartialEq for RawExpression

source§

fn eq(&self, other: &RawExpression) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for RawExpression

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for RawExpression

source§

impl StructuralPartialEq for RawExpression

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,