Struct erg_parser::ast::TypeAscription
source · pub struct TypeAscription {
pub expr: Box<Expr>,
pub t_spec: TypeSpecWithOp,
}
Expand description
type_ascription ::= expr ‘:’ type | expr ‘<:’ type | expr ‘:>’ type
Fields§
§expr: Box<Expr>
§t_spec: TypeSpecWithOp
Implementations§
source§impl TypeAscription
impl TypeAscription
pub fn new(expr: Expr, t_spec: TypeSpecWithOp) -> Self
pub fn kind(&self) -> AscriptionKind
Trait Implementations§
source§impl Clone for TypeAscription
impl Clone for TypeAscription
source§fn clone(&self) -> TypeAscription
fn clone(&self) -> TypeAscription
Returns a copy 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 TypeAscription
impl Debug for TypeAscription
source§impl Display for TypeAscription
impl Display for TypeAscription
source§impl From<TypeAscription> for Expr
impl From<TypeAscription> for Expr
source§fn from(v: TypeAscription) -> Self
fn from(v: TypeAscription) -> Self
Converts to this type from the input type.
source§impl Hash for TypeAscription
impl Hash for TypeAscription
source§impl Locational for TypeAscription
impl Locational for TypeAscription
source§fn loc(&self) -> Location
fn loc(&self) -> Location
NOTE:
loc
cannot be treated as a light method when self
is a large grammatical element.
If possible, delay the computation by passing &impl Locational
or other means.fn ln_begin(&self) -> Option<u32>
fn ln_end(&self) -> Option<u32>
fn col_begin(&self) -> Option<u32>
fn col_end(&self) -> Option<u32>
source§impl NestedDisplay for TypeAscription
impl NestedDisplay for TypeAscription
source§impl PartialEq<TypeAscription> for TypeAscription
impl PartialEq<TypeAscription> for TypeAscription
source§fn eq(&self, other: &TypeAscription) -> bool
fn eq(&self, other: &TypeAscription) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for TypeAscription
impl StructuralEq for TypeAscription
impl StructuralPartialEq for TypeAscription
Auto Trait Implementations§
impl RefUnwindSafe for TypeAscription
impl Send for TypeAscription
impl Sync for TypeAscription
impl Unpin for TypeAscription
impl UnwindSafe for TypeAscription
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