Skip to main content

Types

Struct Types 

Source
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

Source

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.

Source

pub fn recast(&self, e: &Expr) -> Option<&Type>

Source

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.

Source

pub fn binding(&self, n: &Name) -> Option<&Type>

The type of name n a pattern binds.

Source

pub fn constructor(&self, e: &Expr) -> Option<usize>

Which of its type’s constructors new expression e chose.

Source

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.

Source

pub fn method(&self, e: &Expr) -> Option<&MethodUse>

Source

pub fn message(&self, e: &Expr) -> Option<&Message>

Call e across sides, when it’s one.

Source

pub fn is_local(&self, e: &Expr) -> bool

Whether name e is a local’s or a parameter’s (not a member’s).

Source

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.

Source

pub fn bounded(&self, e: &Expr) -> Option<&Type>

The bound value e (of a type parameter) is reached through.

Source

pub fn template(&self, e: &Expr) -> Option<&MessageTemplate>

String e written for a message template, if it’s one.

Source

pub fn of(&self, e: &Expr) -> Option<&Type>

e’s type, if it was checked.

Source

pub fn operator(&self, e: &Expr) -> Option<&OperatorUse>

The declared operator e is, if it’s one.

Source

pub fn conversion(&self, e: &Expr) -> Option<&OperatorUse>

The implicit conversion e’s value goes through, if any.

Source

pub fn assigned(&self, place: &Expr) -> Option<&OperatorUse>

The declared operator place op= … applies, if it’s one.

Trait Implementations§

Source§

impl Debug for Types

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Types

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Types

§

impl RefUnwindSafe for Types

§

impl Send for Types

§

impl Sync for Types

§

impl Unpin for Types

§

impl UnsafeUnpin for Types

§

impl UnwindSafe for Types

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Arg<T> for T

Source§

fn arg(self) -> T

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.