pub struct UnaryOp {
pub operator: UnaryOperator,
pub expr: Expression,
}
Expand description
An operation that applies an operator to one expression.
Fields§
§operator: UnaryOperator
The unary operator to use on the expression.
expr: Expression
An expression that supports evaluation with the unary operator.
Implementations§
Source§impl UnaryOp
impl UnaryOp
Sourcepub fn new<T>(operator: UnaryOperator, expr: T) -> UnaryOpwhere
T: Into<Expression>,
pub fn new<T>(operator: UnaryOperator, expr: T) -> UnaryOpwhere
T: Into<Expression>,
Creates a new UnaryOp
from an operator and an expression.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UnaryOp
impl<'de> Deserialize<'de> for UnaryOp
Source§fn 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
Source§impl Evaluate for UnaryOp
impl Evaluate for UnaryOp
Source§fn evaluate(&self, ctx: &Context<'_>) -> EvalResult<Self::Output>
fn evaluate(&self, ctx: &Context<'_>) -> EvalResult<Self::Output>
Recursively evaluates all HCL templates and expressions in the implementing type using the
variables and functions declared in the
Context
. Read moreSource§fn evaluate_in_place(&mut self, ctx: &Context<'_>) -> EvalResult<(), Errors>
fn evaluate_in_place(&mut self, ctx: &Context<'_>) -> EvalResult<(), Errors>
Recursively tries to evaluate all nested expressions in place. Read more
Source§impl Format for UnaryOp
impl Format for UnaryOp
Source§fn format<W>(&self, fmt: &mut Formatter<'_, W>) -> Result<()>where
W: Write,
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§impl From<UnaryOp> for Expression
impl From<UnaryOp> for Expression
Source§impl<'de> IntoDeserializer<'de, Error> for UnaryOp
impl<'de> IntoDeserializer<'de, Error> for UnaryOp
Source§type Deserializer = MapAccessDeserializer<UnaryOpAccess>
type Deserializer = MapAccessDeserializer<UnaryOpAccess>
The type of the deserializer being converted into.
Source§fn into_deserializer(self) -> Self::Deserializer
fn into_deserializer(self) -> Self::Deserializer
Convert this value into a deserializer.
impl Eq for UnaryOp
impl StructuralPartialEq for UnaryOp
Auto Trait Implementations§
impl Freeze for UnaryOp
impl RefUnwindSafe for UnaryOp
impl Send for UnaryOp
impl Sync for UnaryOp
impl Unpin for UnaryOp
impl UnwindSafe for UnaryOp
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,
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.