#[non_exhaustive]pub enum IacType {
String,
Integer,
Float,
Numeric,
Boolean,
List(Box<IacType>),
Set(Box<IacType>),
Map(Box<IacType>),
Object {
name: String,
fields: Vec<IacAttribute>,
},
Enum {
values: Vec<String>,
underlying: Box<IacType>,
},
Any,
}Expand description
Platform-independent type representation.
Richer than any single platform’s type system – preserves Object structure and Enum values needed by Pulumi schemas, Crossplane CRDs, etc.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
String
Integer
Float
Numeric
Platform-independent numeric type.
Terraform’s number type accepts both integers and floats. This variant
preserves that ambiguity rather than forcing a choice between Integer
and Float at schema-import time.
Boolean
List(Box<IacType>)
Set(Box<IacType>)
Map(Box<IacType>)
Object
Enum
Enum constraint wrapping an underlying type.
values lists the allowed enum variants. underlying is the base type
(typically IacType::String).
Any
Implementations§
Source§impl IacType
impl IacType
Sourcepub fn is_scalar(&self) -> bool
pub fn is_scalar(&self) -> bool
Whether this type is a scalar (String, Integer, Float, Numeric, Boolean).
Sourcepub fn is_composite(&self) -> bool
pub fn is_composite(&self) -> bool
Whether this type is a composite (List, Set, Map, Object).
Sourcepub fn inner_type(&self) -> Option<&IacType>
pub fn inner_type(&self) -> Option<&IacType>
Returns the inner (element) type for container types.
List(T)→Some(&T)Set(T)→Some(&T)Map(T)→Some(&T)(value type; keys are always strings)Enum { underlying, .. }→Some(&underlying)- All others →
None
Trait Implementations§
Source§impl<'de> Deserialize<'de> for IacType
impl<'de> Deserialize<'de> for IacType
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
impl Eq for IacType
Source§impl FromSExpr for IacType
impl FromSExpr for IacType
Source§fn from_sexpr(s: &SExpr) -> Result<Self, SExprError>
fn from_sexpr(s: &SExpr) -> Result<Self, SExprError>
Errors Read more
impl StructuralPartialEq for IacType
Auto Trait Implementations§
impl Freeze for IacType
impl RefUnwindSafe for IacType
impl Send for IacType
impl Sync for IacType
impl Unpin for IacType
impl UnsafeUnpin for IacType
impl UnwindSafe for IacType
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.