pub enum DataType {
StructType {
name: Option<String>,
variables: Vec<Variable>,
},
EnumType {
name: Option<String>,
numeric_type: String,
elements: AstNode,
},
SubRangeType {
name: Option<String>,
referenced_type: String,
referenced_type_location: SourceLocation,
bounds: Option<AstNode>,
},
ArrayType {
name: Option<String>,
bounds: AstNode,
referenced_type: Box<DataTypeDeclaration>,
is_variable_length: bool,
},
PointerType {
name: Option<String>,
referenced_type: Box<DataTypeDeclaration>,
auto_deref: Option<AutoDerefType>,
type_safe: bool,
is_function: bool,
},
StringType {
name: Option<String>,
is_wide: bool,
size: Option<AstNode>,
},
VarArgs {
referenced_type: Option<Box<DataTypeDeclaration>>,
sized: bool,
},
GenericType {
name: String,
generic_symbol: String,
nature: TypeNature,
},
}Variants§
StructType
EnumType
SubRangeType
Fields
§
referenced_type_location: SourceLocationSource location of referenced_type. Used by validation to point at
the actual offending token when the referenced type is unknown.
ArrayType
Fields
§
referenced_type: Box<DataTypeDeclaration>PointerType
Fields
§
referenced_type: Box<DataTypeDeclaration>§
auto_deref: Option<AutoDerefType>StringType
VarArgs
GenericType
Implementations§
Source§impl DataType
impl DataType
pub fn set_name(&mut self, new_name: String)
pub fn get_name(&self) -> Option<&str>
pub fn replace_data_type_with_reference_to( &mut self, type_name: String, location: &SourceLocation, ) -> Option<DataTypeDeclaration>
pub fn is_pointer(&self) -> bool
pub fn is_type_safe_pointer(&self) -> bool
pub fn is_generic(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DataTypewhere
'de: 'static,
impl<'de> Deserialize<'de> for DataTypewhere
'de: 'static,
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 WalkerMut for DataType
impl WalkerMut for DataType
fn walk<V>(&mut self, visitor: &mut V)where
V: AstVisitorMut,
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnsafeUnpin for DataType
impl UnwindSafe for DataType
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