pub struct TypeAnnotation {
pub type_name: String,
}Expand description
Type annotation for a term.
This is the simple string-based type annotation. For parametric types,
use ParametricType which supports type constructors and variables.
Fields§
§type_name: StringImplementations§
Source§impl TypeAnnotation
impl TypeAnnotation
pub fn new(type_name: impl Into<String>) -> Self
Sourcepub fn to_parametric(&self) -> ParametricType
pub fn to_parametric(&self) -> ParametricType
Convert to a parametric type (concrete type)
Sourcepub fn from_parametric(ty: &ParametricType) -> Option<Self>
pub fn from_parametric(ty: &ParametricType) -> Option<Self>
Create from a parametric type if it’s a concrete type
Trait Implementations§
Source§impl Clone for TypeAnnotation
impl Clone for TypeAnnotation
Source§fn clone(&self) -> TypeAnnotation
fn clone(&self) -> TypeAnnotation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TypeAnnotation
impl Debug for TypeAnnotation
Source§impl<'de> Deserialize<'de> for TypeAnnotation
impl<'de> Deserialize<'de> for TypeAnnotation
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 Hash for TypeAnnotation
impl Hash for TypeAnnotation
Source§impl PartialEq for TypeAnnotation
impl PartialEq for TypeAnnotation
Source§impl Serialize for TypeAnnotation
impl Serialize for TypeAnnotation
impl Eq for TypeAnnotation
impl StructuralPartialEq for TypeAnnotation
Auto Trait Implementations§
impl Freeze for TypeAnnotation
impl RefUnwindSafe for TypeAnnotation
impl Send for TypeAnnotation
impl Sync for TypeAnnotation
impl Unpin for TypeAnnotation
impl UnwindSafe for TypeAnnotation
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