pub struct Type {
pub base_type: BaseType,
pub is_array: bool,
pub array_size: Option<u32>,
pub is_upper_bound: bool,
}Expand description
Type information including array specifiers
Fields§
§base_type: BaseTypeBase type information
is_array: boolWhether this is an array type
array_size: Option<u32>Array size (None for dynamic arrays)
is_upper_bound: boolWhether array_size is an upper bound
Implementations§
Source§impl Type
impl Type
Sourcepub fn new(
type_string: &str,
context_package_name: Option<&str>,
) -> ParseResult<Self>
pub fn new( type_string: &str, context_package_name: Option<&str>, ) -> ParseResult<Self>
Create a new Type from a type string
§Errors
Returns an error if:
- The type string contains invalid array syntax
- Array size bounds are invalid or out of range
- The base type string is invalid or unsupported
Sourcepub fn is_primitive_type(&self) -> bool
pub fn is_primitive_type(&self) -> bool
Check if this is a primitive type
Sourcepub fn is_dynamic_array(&self) -> bool
pub fn is_dynamic_array(&self) -> bool
Check if this is a dynamic array (array without fixed size)
Sourcepub fn is_bounded_array(&self) -> bool
pub fn is_bounded_array(&self) -> bool
Check if this is a bounded array (array with upper bound)
Trait Implementations§
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnsafeUnpin for Type
impl UnwindSafe for Type
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