pub struct UserTypeDecl {
pub name: String,
pub params: Vec<String>,
pub ctors: Vec<(String, Option<TypeExpr>)>,
}Expand description
A user type declaration, surfaced (but not yet lowered into
crate::types::MonoType — that’s typecheck::build_variant_decl’s job)
from a CST cst::TypeDecl. Ctor payload types are kept as raw CST
TypeExprs: cheap to clone, and this untyped elaborator has no use for
them beyond passing them through to the typechecker.
Fields§
§name: String§params: Vec<String>Type-parameter names, in declaration order (e.g. ["a"] for 'a).
ctors: Vec<(String, Option<TypeExpr>)>(ctor name, payload type expr), in declaration order.
Trait Implementations§
Source§impl Clone for UserTypeDecl
impl Clone for UserTypeDecl
Source§fn clone(&self) -> UserTypeDecl
fn clone(&self) -> UserTypeDecl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for UserTypeDecl
impl RefUnwindSafe for UserTypeDecl
impl Send for UserTypeDecl
impl Sync for UserTypeDecl
impl Unpin for UserTypeDecl
impl UnsafeUnpin for UserTypeDecl
impl UnwindSafe for UserTypeDecl
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more