Struct brane_dsl::symbol_table::ClassEntry
source · pub struct ClassEntry {
pub signature: ClassSignature,
pub symbol_table: Rc<RefCell<SymbolTable>>,
pub package_name: Option<String>,
pub package_version: Option<Version>,
pub index: usize,
pub range: TextRange,
}
Expand description
Defines a class entry (i.e., custom type) within the SymbolTable.
Fields§
§signature: ClassSignature
The signature of the class (i.e., its name).
symbol_table: Rc<RefCell<SymbolTable>>
References the SymbolTable where the nested declarations are present. This is used to resolve projection on the class.
package_name: Option<String>
If populated, then this Class was defined in a package with the given name.
package_version: Option<Version>
If set to non-zero, then this function is imported from a package with the given version.
index: usize
The index in the workflow buffer of this class.
range: TextRange
Points to the entire class definition (or import).
Implementations§
source§impl ClassEntry
impl ClassEntry
sourcepub fn from_builtin(
signature: ClassSignature,
symbol_table: Rc<RefCell<SymbolTable>>,
range: TextRange,
) -> Self
pub fn from_builtin( signature: ClassSignature, symbol_table: Rc<RefCell<SymbolTable>>, range: TextRange, ) -> Self
Creates a ClassEntry as if it was defined as a builtin type.
§Arguments
signature
: The signature of the ClassEntry (contains its name).symbol_table
: The nested SymbolTable that this Class uses to identify its fields.range
: The TextRange that points to the definition itself.
§Returns
A new ClassEntry that has no package set, but does have type information populated.
sourcepub fn from_def(
signature: ClassSignature,
symbol_table: Rc<RefCell<SymbolTable>>,
range: TextRange,
) -> Self
pub fn from_def( signature: ClassSignature, symbol_table: Rc<RefCell<SymbolTable>>, range: TextRange, ) -> Self
Creates a ClassEntry as if it was defined in the source text.
§Arguments
signature
: The signature of the ClassEntry (contains its name).symbol_table
: The nested SymbolTable that this Class uses to identify its fields.range
: The TextRange that points to the definition itself.
§Returns
A new ClassEntry that has no package set, but does have type information populated.
sourcepub fn from_import<S: Into<String>>(
signature: ClassSignature,
symbol_table: Rc<RefCell<SymbolTable>>,
package: S,
package_version: Version,
range: TextRange,
) -> Self
pub fn from_import<S: Into<String>>( signature: ClassSignature, symbol_table: Rc<RefCell<SymbolTable>>, package: S, package_version: Version, range: TextRange, ) -> Self
Creates a ClassEntry as if it was imported by the given package.
§Generic arguments
S
: The String-like type of thepackage
.
§Arguments
name
: The name of the ClassEntry.symbol_table
: The nested SymbolTable that this Class uses to identify its fields.package
: The name of the package to which this class belongs.package_version
: The version of the package to which this function belongs.range
: The TextRange that points to the definition itself (i.e., the import statement).
§Returns
A new ClassEntry that has the given package set and is defined as not having methods.
Trait Implementations§
source§impl Clone for ClassEntry
impl Clone for ClassEntry
source§fn clone(&self) -> ClassEntry
fn clone(&self) -> ClassEntry
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for ClassEntry
impl !RefUnwindSafe for ClassEntry
impl !Send for ClassEntry
impl !Sync for ClassEntry
impl Unpin for ClassEntry
impl !UnwindSafe for ClassEntry
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request