Struct go_types::LangObj

source ·
pub struct LangObj { /* private fields */ }
Expand description

A LangObj describes a named language entity such as a package, constant, type, variable, function (incl. methods), or label.

Implementations§

source§

impl LangObj

source

pub fn new_pkg_name( pos: Pos, pkg: Option<PackageKey>, name: String, imported: PackageKey, univ: &Universe ) -> LangObj

source

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

source

pub fn new_type_name( pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey> ) -> LangObj

source

pub fn new_var( pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey> ) -> LangObj

source

pub fn new_param_var( pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey> ) -> LangObj

source

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

source

pub fn new_func( pos: Pos, pkg: Option<PackageKey>, name: String, typ: Option<TypeKey> ) -> LangObj

source

pub fn new_label( pos: Pos, pkg: Option<PackageKey>, name: String, univ: &Universe ) -> LangObj

source

pub fn new_builtin(f: Builtin, name: String, typ: TypeKey) -> LangObj

source

pub fn new_nil(typ: TypeKey) -> LangObj

source

pub fn entity_type(&self) -> &EntityType

source

pub fn entity_type_mut(&mut self) -> &mut EntityType

source

pub fn parent(&self) -> Option<ScopeKey>

source

pub fn pos(&self) -> Pos

source

pub fn name(&self) -> &String

source

pub fn typ(&self) -> Option<TypeKey>

source

pub fn pkg(&self) -> Option<PackageKey>

source

pub fn exported(&self) -> bool

source

pub fn id(&self, objs: &TCObjects) -> Cow<'_, str>

source

pub fn order(&self) -> u32

source

pub fn scope_pos(&self) -> &Pos

source

pub fn set_order(&mut self, order: u32)

source

pub fn same_id( &self, pkg: Option<PackageKey>, name: &str, objs: &TCObjects ) -> bool

source

pub fn pkg_name_imported(&self) -> PackageKey

source

pub fn const_val(&self) -> &Value

source

pub fn var_embedded(&self) -> bool

source

pub fn var_is_field(&self) -> bool

source

pub fn func_fmt_name(&self, f: &mut Formatter<'_>, objs: &TCObjects) -> Result

source

pub fn func_scope(&self) -> &ScopeKey

Trait Implementations§

source§

impl Clone for LangObj

source§

fn clone(&self) -> LangObj

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LangObj

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.