Struct TCObjects

Source
pub struct TCObjects {
    pub lobjs: DenseSlotMap<ObjKey, LangObj>,
    pub types: DenseSlotMap<TypeKey, Type>,
    pub pkgs: DenseSlotMap<PackageKey, Package>,
    pub decls: DenseSlotMap<DeclInfoKey, DeclInfo>,
    pub scopes: DenseSlotMap<ScopeKey, Scope>,
    pub universe: Option<Universe>,
    pub fmt_qualifier: Box<dyn Fn(&Package) -> Cow<'_, str>>,
}
Expand description

The container of all “managed” objects also works as a “global” variable holder

Fields§

§lobjs: DenseSlotMap<ObjKey, LangObj>§types: DenseSlotMap<TypeKey, Type>§pkgs: DenseSlotMap<PackageKey, Package>§decls: DenseSlotMap<DeclInfoKey, DeclInfo>§scopes: DenseSlotMap<ScopeKey, Scope>§universe: Option<Universe>§fmt_qualifier: Box<dyn Fn(&Package) -> Cow<'_, str>>

Implementations§

Source§

impl TCObjects

Source

pub fn new() -> TCObjects

Source

pub fn universe(&self) -> &Universe

Source

pub fn new_scope( &mut self, parent: Option<ScopeKey>, pos: Pos, end: Pos, comment: String, is_func: bool, ) -> ScopeKey

Source

pub fn new_package(&mut self, path: String) -> PackageKey

Source

pub fn new_pkg_name( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, imported: PackageKey, ) -> ObjKey

Source

pub fn new_const( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey>, val: Value, ) -> ObjKey

Source

pub fn new_type_name( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey>, ) -> ObjKey

Source

pub fn new_var( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey>, ) -> ObjKey

Source

pub fn new_param_var( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey>, ) -> ObjKey

Source

pub fn new_field( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey>, embedded: bool, ) -> ObjKey

Source

pub fn new_func( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey>, ) -> ObjKey

Source

pub fn new_label( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, ) -> ObjKey

Source

pub fn new_t_basic( &mut self, typ: BasicType, info: BasicInfo, name: &'static str, ) -> TypeKey

Source

pub fn new_t_array(&mut self, elem: TypeKey, len: Option<u64>) -> TypeKey

Source

pub fn new_t_slice(&mut self, elem: TypeKey) -> TypeKey

Source

pub fn new_t_struct( &mut self, fields: Vec<ObjKey>, tags: Option<Vec<Option<String>>>, ) -> TypeKey

Source

pub fn new_t_pointer(&mut self, base: TypeKey) -> TypeKey

Source

pub fn new_t_tuple(&mut self, vars: Vec<ObjKey>) -> TypeKey

Source

pub fn new_t_signature( &mut self, scope: Option<ScopeKey>, recv: Option<ObjKey>, params: TypeKey, results: TypeKey, variadic: bool, ) -> TypeKey

Source

pub fn new_t_interface( &mut self, methods: Vec<ObjKey>, embeddeds: Vec<TypeKey>, ) -> TypeKey

Source

pub fn new_t_empty_interface(&mut self) -> TypeKey

Source

pub fn new_t_map(&mut self, key: TypeKey, elem: TypeKey) -> TypeKey

Source

pub fn new_t_chan(&mut self, dir: ChanDir, elem: TypeKey) -> TypeKey

Source

pub fn new_t_named( &mut self, obj: Option<ObjKey>, underlying: Option<TypeKey>, methods: Vec<ObjKey>, ) -> TypeKey

Auto Trait Implementations§

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> 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 = 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.