pub(crate) struct ExprResult<'db> {
pub temporaries: Vec<Temporary<'db>>,
pub span: Span<'db>,
pub kind: ExprResultKind<'db>,
}Fields§
§temporaries: Vec<Temporary<'db>>List of Temporary variables created by this expression.
span: Span<'db>Span of the expression
kind: ExprResultKind<'db>The primary result from translating an expression. Note that an ast-expr can result in many kinds of things.
Implementations§
Source§impl<'db> ExprResult<'db>
impl<'db> ExprResult<'db>
Sourcepub async fn from_name_resolution(
env: &mut Env<'db>,
res: NameResolution<'db>,
span: Span<'db>,
) -> Self
pub async fn from_name_resolution( env: &mut Env<'db>, res: NameResolution<'db>, span: Span<'db>, ) -> Self
Create a result based on lexical name resolution.
pub fn from_place_expr( db: &'db dyn Db, expr: SymPlaceExpr<'db>, temporaries: Vec<Temporary<'db>>, ) -> Self
pub fn from_expr( db: &'db dyn Db, expr: SymExpr<'db>, temporaries: Vec<Temporary<'db>>, ) -> Self
Sourcepub fn into_expr_with_enclosed_temporaries(
self,
env: &mut Env<'db>,
) -> SymExpr<'db>
pub fn into_expr_with_enclosed_temporaries( self, env: &mut Env<'db>, ) -> SymExpr<'db>
Convert this result into an expression, with let ... in statements inserted for temporaries.
Sourcepub fn ty(&self, env: &mut Env<'db>) -> SymTy<'db>
pub fn ty(&self, env: &mut Env<'db>) -> SymTy<'db>
Computes the type of this, treating it as an expression. Reports an error if this names something that cannot be made into an expression.
pub fn into_place_expr( self, env: &mut Env<'db>, temporaries: &mut Vec<Temporary<'db>>, ) -> SymPlaceExpr<'db>
pub fn into_expr( self, env: &mut Env<'db>, temporaries: &mut Vec<Temporary<'db>>, ) -> SymExpr<'db>
Trait Implementations§
Source§impl<'db> Clone for ExprResult<'db>
impl<'db> Clone for ExprResult<'db>
Source§fn clone(&self) -> ExprResult<'db>
fn clone(&self) -> ExprResult<'db>
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 moreAuto Trait Implementations§
impl<'db> Freeze for ExprResult<'db>
impl<'db> !RefUnwindSafe for ExprResult<'db>
impl<'db> Send for ExprResult<'db>
impl<'db> Sync for ExprResult<'db>
impl<'db> Unpin for ExprResult<'db>
impl<'db> UnsafeUnpin for ExprResult<'db>
impl<'db> !UnwindSafe for ExprResult<'db>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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