pub struct Types { /* private fields */ }Expand description
The types of a checked file’s expressions. An expression is known by its node in the file’s tree — which, once checked, isn’t changed — so two that share a place (a macro’s output, all at its call) stay apart.
Implementations§
Source§impl Types
impl Types
Sourcepub fn quoted(&self, e: &Expr) -> Option<&Quoted>
pub fn quoted(&self, e: &Expr) -> Option<&Quoted>
The type e’s value is recast to, going where it’s wanted by
variance (IEnumerable<string> as an IEnumerable<object>).
Lambda e as an expression tree, when it’s given as one.
pub fn recast(&self, e: &Expr) -> Option<&Type>
Sourcepub fn item(&self, iter: &Expr) -> Option<&Type>
pub fn item(&self, iter: &Expr) -> Option<&Type>
The method call e chose, when it’s an own one.
What foreach over iter gives each time.
Sourcepub fn constructor(&self, e: &Expr) -> Option<usize>
pub fn constructor(&self, e: &Expr) -> Option<usize>
Which of its type’s constructors new expression e chose.
Sourcepub fn constructor_rest(&self, e: &Expr) -> Option<&(usize, Type)>
pub fn constructor_rest(&self, e: &Expr) -> Option<&(usize, Type)>
Where new expression e’s params arguments start, and their
item type, when it packs them.
pub fn method(&self, e: &Expr) -> Option<&MethodUse>
Sourcepub fn is_local(&self, e: &Expr) -> bool
pub fn is_local(&self, e: &Expr) -> bool
Whether name e is a local’s or a parameter’s (not a member’s).
Sourcepub fn moved_away(&self, e: &Expr) -> &[String]
pub fn moved_away(&self, e: &Expr) -> &[String]
The locals lambda e takes with it to another thread: moved away
from the code around it.
Sourcepub fn bounded(&self, e: &Expr) -> Option<&Type>
pub fn bounded(&self, e: &Expr) -> Option<&Type>
The bound value e (of a type parameter) is reached through.
Sourcepub fn template(&self, e: &Expr) -> Option<&MessageTemplate>
pub fn template(&self, e: &Expr) -> Option<&MessageTemplate>
String e written for a message template, if it’s one.
Sourcepub fn operator(&self, e: &Expr) -> Option<&OperatorUse>
pub fn operator(&self, e: &Expr) -> Option<&OperatorUse>
The declared operator e is, if it’s one.
Sourcepub fn conversion(&self, e: &Expr) -> Option<&OperatorUse>
pub fn conversion(&self, e: &Expr) -> Option<&OperatorUse>
The implicit conversion e’s value goes through, if any.
Sourcepub fn assigned(&self, place: &Expr) -> Option<&OperatorUse>
pub fn assigned(&self, place: &Expr) -> Option<&OperatorUse>
The declared operator place op= … applies, if it’s one.