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
impl TCObjects
pub fn new() -> TCObjects
pub fn universe(&self) -> &Universe
pub fn new_scope( &mut self, parent: Option<ScopeKey>, pos: Pos, end: Pos, comment: String, is_func: bool, ) -> ScopeKey
pub fn new_package(&mut self, path: String) -> PackageKey
pub fn new_pkg_name( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, imported: PackageKey, ) -> ObjKey
pub fn new_const( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey>, val: Value, ) -> ObjKey
pub fn new_type_name( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey>, ) -> ObjKey
pub fn new_var( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey>, ) -> ObjKey
pub fn new_param_var( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey>, ) -> ObjKey
pub fn new_field( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey>, embedded: bool, ) -> ObjKey
pub fn new_func( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey>, ) -> ObjKey
pub fn new_label( &mut self, pos: Pos, pkg: Option<PackageKey>, name: String, ) -> ObjKey
pub fn new_t_basic( &mut self, typ: BasicType, info: BasicInfo, name: &'static str, ) -> TypeKey
pub fn new_t_array(&mut self, elem: TypeKey, len: Option<u64>) -> TypeKey
pub fn new_t_slice(&mut self, elem: TypeKey) -> TypeKey
pub fn new_t_struct( &mut self, fields: Vec<ObjKey>, tags: Option<Vec<Option<String>>>, ) -> TypeKey
pub fn new_t_pointer(&mut self, base: TypeKey) -> TypeKey
pub fn new_t_tuple(&mut self, vars: Vec<ObjKey>) -> TypeKey
pub fn new_t_signature( &mut self, scope: Option<ScopeKey>, recv: Option<ObjKey>, params: TypeKey, results: TypeKey, variadic: bool, ) -> TypeKey
pub fn new_t_interface( &mut self, methods: Vec<ObjKey>, embeddeds: Vec<TypeKey>, ) -> TypeKey
pub fn new_t_empty_interface(&mut self) -> TypeKey
pub fn new_t_map(&mut self, key: TypeKey, elem: TypeKey) -> TypeKey
pub fn new_t_chan(&mut self, dir: ChanDir, elem: TypeKey) -> TypeKey
pub fn new_t_named( &mut self, obj: Option<ObjKey>, underlying: Option<TypeKey>, methods: Vec<ObjKey>, ) -> TypeKey
Auto Trait Implementations§
impl Freeze for TCObjects
impl !RefUnwindSafe for TCObjects
impl !Send for TCObjects
impl !Sync for TCObjects
impl Unpin for TCObjects
impl !UnwindSafe for TCObjects
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