pub struct TypeContext<'a> {
pub expected_type: Option<&'a Type>,
}
Expand description
Type checking context
Fields§
§expected_type: Option<&'a Type>
Expected type for the current expression
Implementations§
Source§impl<'a> TypeContext<'a>
impl<'a> TypeContext<'a>
pub const fn new(expected_type: Option<&'a Type>) -> Self
pub const fn new_argument(required_type: &'a Type) -> Self
pub const fn new_unsure_argument(expected_type: Option<&'a Type>) -> Self
pub const fn new_anything_argument() -> Self
pub const fn new_function(required_type: &'a Type) -> Self
pub const fn with_expected_type(&self, expected_type: Option<&'a Type>) -> Self
Trait Implementations§
Source§impl<'a> Clone for TypeContext<'a>
impl<'a> Clone for TypeContext<'a>
Source§fn clone(&self) -> TypeContext<'a>
fn clone(&self) -> TypeContext<'a>
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 moreAuto Trait Implementations§
impl<'a> Freeze for TypeContext<'a>
impl<'a> RefUnwindSafe for TypeContext<'a>
impl<'a> Send for TypeContext<'a>
impl<'a> Sync for TypeContext<'a>
impl<'a> Unpin for TypeContext<'a>
impl<'a> UnwindSafe for TypeContext<'a>
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