pub struct ConcreteType {
pub kind: ConcreteTypeKind,
pub nullable: bool,
}Available on crate feature
parse only.Expand description
A concrete, fully-resolved type instance with nullability.
Fields§
§kind: ConcreteTypeKindThe resolved type shape
nullable: boolWhether this type is nullable
Implementations§
Source§impl ConcreteType
impl ConcreteType
Sourcepub fn builtin(builtin_type: BasicBuiltinType, nullable: bool) -> ConcreteType
pub fn builtin(builtin_type: BasicBuiltinType, nullable: bool) -> ConcreteType
Create a new builtin scalar type
Sourcepub fn extension(name: String, nullable: bool) -> ConcreteType
pub fn extension(name: String, nullable: bool) -> ConcreteType
Create a new extension type reference (without parameters)
Sourcepub fn extension_with_params(
name: String,
parameters: Vec<TypeParameter>,
nullable: bool,
) -> ConcreteType
pub fn extension_with_params( name: String, parameters: Vec<TypeParameter>, nullable: bool, ) -> ConcreteType
Create a new parameterized extension type
Sourcepub fn list(element_type: ConcreteType, nullable: bool) -> ConcreteType
pub fn list(element_type: ConcreteType, nullable: bool) -> ConcreteType
Create a new list type
Sourcepub fn struct(field_types: Vec<ConcreteType>, nullable: bool) -> ConcreteType
pub fn struct(field_types: Vec<ConcreteType>, nullable: bool) -> ConcreteType
Create a new struct type (ordered fields without names)
Sourcepub fn map(
key_type: ConcreteType,
value_type: ConcreteType,
nullable: bool,
) -> ConcreteType
pub fn map( key_type: ConcreteType, value_type: ConcreteType, nullable: bool, ) -> ConcreteType
Create a new map type
Sourcepub fn named_struct(
fields: IndexMap<String, ConcreteType>,
nullable: bool,
) -> ConcreteType
pub fn named_struct( fields: IndexMap<String, ConcreteType>, nullable: bool, ) -> ConcreteType
Create a new named struct type (nstruct - ordered fields with names)
Sourcepub fn is_compatible_with(&self, other: &ConcreteType) -> bool
pub fn is_compatible_with(&self, other: &ConcreteType) -> bool
Check if this type (as a function argument) is compatible with another type (as an input).
Mainly checks nullability:
i64?is compatible withi64andi64?- both can be passed as argumentsi64is compatible withi64but NOTi64?- you can’t pass a nullable type to a function that only accepts non-nullable arguments
Trait Implementations§
Source§impl Clone for ConcreteType
impl Clone for ConcreteType
Source§fn clone(&self) -> ConcreteType
fn clone(&self) -> ConcreteType
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConcreteType
impl Debug for ConcreteType
Source§impl Display for ConcreteType
impl Display for ConcreteType
Source§impl From<ConcreteType> for Type
impl From<ConcreteType> for Type
Source§fn from(val: ConcreteType) -> Self
fn from(val: ConcreteType) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ConcreteType
impl PartialEq for ConcreteType
Source§impl<'a> TryFrom<TypeExpr<'a>> for ConcreteType
impl<'a> TryFrom<TypeExpr<'a>> for ConcreteType
impl StructuralPartialEq for ConcreteType
Auto Trait Implementations§
impl Freeze for ConcreteType
impl RefUnwindSafe for ConcreteType
impl Send for ConcreteType
impl Sync for ConcreteType
impl Unpin for ConcreteType
impl UnwindSafe for ConcreteType
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)