Hir

Struct Hir 

Source
pub struct Hir<'hir> { /* private fields */ }
Expand description

The high-level intermediate representation (HIR).

This struct contains all the information about the entire program.

Implementations§

Source§

impl<'hir> Hir<'hir>

Source

pub fn source(&self, id: SourceId) -> &Source<'hir>

Returns the source associated with the given ID.

Source

pub fn source_ids(&self) -> impl ExactSizeIterator + Clone + use<>

Returns an iterator over all of the source IDs.

Source

pub fn par_source_ids(&self) -> impl IndexedParallelIterator + use<>

Returns a parallel iterator over all of the source IDs.

Source

pub fn sources(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the source values.

Source

pub fn par_sources(&self) -> impl IndexedParallelIterator

Returns a parallel iterator over all of the source values.

Source

pub fn sources_enumerated(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the source IDs and their associated values.

Source

pub fn par_sources_enumerated(&self) -> impl IndexedParallelIterator

Returns an iterator over all of the source IDs and their associated values.

Source

pub fn contract(&self, id: ContractId) -> &Contract<'hir>

Returns the contract associated with the given ID.

Source

pub fn contract_ids(&self) -> impl ExactSizeIterator + Clone + use<>

Returns an iterator over all of the contract IDs.

Source

pub fn par_contract_ids(&self) -> impl IndexedParallelIterator + use<>

Returns a parallel iterator over all of the contract IDs.

Source

pub fn contracts(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the contract values.

Source

pub fn par_contracts(&self) -> impl IndexedParallelIterator

Returns a parallel iterator over all of the contract values.

Source

pub fn contracts_enumerated(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the contract IDs and their associated values.

Source

pub fn par_contracts_enumerated(&self) -> impl IndexedParallelIterator

Returns an iterator over all of the contract IDs and their associated values.

Source

pub fn function(&self, id: FunctionId) -> &Function<'hir>

Returns the function associated with the given ID.

Source

pub fn function_ids(&self) -> impl ExactSizeIterator + Clone + use<>

Returns an iterator over all of the function IDs.

Source

pub fn par_function_ids(&self) -> impl IndexedParallelIterator + use<>

Returns a parallel iterator over all of the function IDs.

Source

pub fn functions(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the function values.

Source

pub fn par_functions(&self) -> impl IndexedParallelIterator

Returns a parallel iterator over all of the function values.

Source

pub fn functions_enumerated(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the function IDs and their associated values.

Source

pub fn par_functions_enumerated(&self) -> impl IndexedParallelIterator

Returns an iterator over all of the function IDs and their associated values.

Source

pub fn strukt(&self, id: StructId) -> &Struct<'hir>

Returns the strukt associated with the given ID.

Source

pub fn strukt_ids(&self) -> impl ExactSizeIterator + Clone + use<>

Returns an iterator over all of the strukt IDs.

Source

pub fn par_strukt_ids(&self) -> impl IndexedParallelIterator + use<>

Returns a parallel iterator over all of the strukt IDs.

Source

pub fn structs(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the strukt values.

Source

pub fn par_structs(&self) -> impl IndexedParallelIterator

Returns a parallel iterator over all of the strukt values.

Source

pub fn structs_enumerated(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the strukt IDs and their associated values.

Source

pub fn par_structs_enumerated(&self) -> impl IndexedParallelIterator

Returns an iterator over all of the strukt IDs and their associated values.

Source

pub fn enumm(&self, id: EnumId) -> &Enum<'hir>

Returns the enumm associated with the given ID.

Source

pub fn enumm_ids(&self) -> impl ExactSizeIterator + Clone + use<>

Returns an iterator over all of the enumm IDs.

Source

pub fn par_enumm_ids(&self) -> impl IndexedParallelIterator + use<>

Returns a parallel iterator over all of the enumm IDs.

Source

pub fn enums(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the enumm values.

Source

pub fn par_enums(&self) -> impl IndexedParallelIterator

Returns a parallel iterator over all of the enumm values.

Source

pub fn enums_enumerated(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the enumm IDs and their associated values.

Source

pub fn par_enums_enumerated(&self) -> impl IndexedParallelIterator

Returns an iterator over all of the enumm IDs and their associated values.

Source

pub fn udvt(&self, id: UdvtId) -> &Udvt<'hir>

Returns the udvt associated with the given ID.

Source

pub fn udvt_ids(&self) -> impl ExactSizeIterator + Clone + use<>

Returns an iterator over all of the udvt IDs.

Source

pub fn par_udvt_ids(&self) -> impl IndexedParallelIterator + use<>

Returns a parallel iterator over all of the udvt IDs.

Source

pub fn udvts(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the udvt values.

Source

pub fn par_udvts(&self) -> impl IndexedParallelIterator

Returns a parallel iterator over all of the udvt values.

Source

pub fn udvts_enumerated(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the udvt IDs and their associated values.

Source

pub fn par_udvts_enumerated(&self) -> impl IndexedParallelIterator

Returns an iterator over all of the udvt IDs and their associated values.

Source

pub fn event(&self, id: EventId) -> &Event<'hir>

Returns the event associated with the given ID.

Source

pub fn event_ids(&self) -> impl ExactSizeIterator + Clone + use<>

Returns an iterator over all of the event IDs.

Source

pub fn par_event_ids(&self) -> impl IndexedParallelIterator + use<>

Returns a parallel iterator over all of the event IDs.

Source

pub fn events(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the event values.

Source

pub fn par_events(&self) -> impl IndexedParallelIterator

Returns a parallel iterator over all of the event values.

Source

pub fn events_enumerated(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the event IDs and their associated values.

Source

pub fn par_events_enumerated(&self) -> impl IndexedParallelIterator

Returns an iterator over all of the event IDs and their associated values.

Source

pub fn error(&self, id: ErrorId) -> &Error<'hir>

Returns the error associated with the given ID.

Source

pub fn error_ids(&self) -> impl ExactSizeIterator + Clone + use<>

Returns an iterator over all of the error IDs.

Source

pub fn par_error_ids(&self) -> impl IndexedParallelIterator + use<>

Returns a parallel iterator over all of the error IDs.

Source

pub fn errors(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the error values.

Source

pub fn par_errors(&self) -> impl IndexedParallelIterator

Returns a parallel iterator over all of the error values.

Source

pub fn errors_enumerated(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the error IDs and their associated values.

Source

pub fn par_errors_enumerated(&self) -> impl IndexedParallelIterator

Returns an iterator over all of the error IDs and their associated values.

Source

pub fn variable(&self, id: VariableId) -> &Variable<'hir>

Returns the variable associated with the given ID.

Source

pub fn variable_ids(&self) -> impl ExactSizeIterator + Clone + use<>

Returns an iterator over all of the variable IDs.

Source

pub fn par_variable_ids(&self) -> impl IndexedParallelIterator + use<>

Returns a parallel iterator over all of the variable IDs.

Source

pub fn variables(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the variable values.

Source

pub fn par_variables(&self) -> impl IndexedParallelIterator

Returns a parallel iterator over all of the variable values.

Source

pub fn variables_enumerated(&self) -> impl ExactSizeIterator + Clone

Returns an iterator over all of the variable IDs and their associated values.

Source

pub fn par_variables_enumerated(&self) -> impl IndexedParallelIterator

Returns an iterator over all of the variable IDs and their associated values.

Source

pub fn item(&self, id: impl Into<ItemId>) -> Item<'_, 'hir>

Returns the item associated with the given ID.

Source

pub fn item_ids(&self) -> impl Iterator<Item = ItemId> + Clone

Returns an iterator over all item IDs.

Source

pub fn par_item_ids(&self) -> impl ParallelIterator<Item = ItemId>

Returns a parallel iterator over all item IDs.

Source

pub fn contract_item_ids( &self, id: ContractId, ) -> impl Iterator<Item = ItemId> + Clone + use<'_>

Returns an iterator over all item IDs in a contract, including inheritance.

Source

pub fn contract_items( &self, id: ContractId, ) -> impl Iterator<Item = Item<'_, 'hir>> + Clone

Returns an iterator over all items in a contract, including inheritance.

Trait Implementations§

Source§

impl<'hir> Debug for Hir<'hir>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'hir> Freeze for Hir<'hir>

§

impl<'hir> RefUnwindSafe for Hir<'hir>

§

impl<'hir> Send for Hir<'hir>

§

impl<'hir> Sync for Hir<'hir>

§

impl<'hir> Unpin for Hir<'hir>

§

impl<'hir> UnwindSafe for Hir<'hir>

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> 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, R> CollectAndApply<T, R> for T

Source§

fn collect_and_apply<I, F>(iter: I, f: F) -> R
where I: Iterator<Item = T>, F: FnOnce(&[T]) -> R,

Equivalent to f(&iter.collect::<Vec<_>>()).

Source§

type Output = R

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more