Struct brane_dsl::symbol_table::VarEntry
source · pub struct VarEntry {
pub name: String,
pub data_type: DataType,
pub function_name: Option<String>,
pub class_name: Option<String>,
pub index: usize,
pub range: TextRange,
}
Expand description
Defines a regular variable entry within the SymbolTable.
Fields§
§name: String
The name/identifier of the variable.
data_type: DataType
The data type of the variable (i.e., its signature).
A DataType of DataType::Any
indicates that the data type may still need to be resolved in the typing phase. After that, though, it means there is not enough information to actually determine the variable’s type at compile time.
function_name: Option<String>
If this variable is actually a parameter of a function, the this field contains the function’s name.
class_name: Option<String>
If this variable is actually a property of a class, the this field contains the class’s name.
index: usize
The index in the workflow buffer of this variable.
range: TextRange
The range that points to the entire definition of the variable entry.
Implementations§
source§impl VarEntry
impl VarEntry
sourcepub fn from_def<S: Into<String>>(name: S, range: TextRange) -> Self
pub fn from_def<S: Into<String>>(name: S, range: TextRange) -> Self
Creates a VarEntry as if it was defined in the source text.
§Generic arguments
S
: The String-like type of the variable’sname
.
§Arguments
name
: The name of the VarEntry.range
: The TextRange that points to the definition itself.
§Returns
A new VarEntry that has no function or class set, and not yet any type information populated.
sourcepub fn from_param<S1: Into<String>, S2: Into<String>>(
name: S1,
function: S2,
range: TextRange,
) -> Self
pub fn from_param<S1: Into<String>, S2: Into<String>>( name: S1, function: S2, range: TextRange, ) -> Self
Creates a VarEntry as if it was a parameter of a function.
§Generic arguments
S1
: The String-like type of the variable’sname
.S2
: The String-like type of thefunction
.
§Arguments
name
: The name of the VarEntry.function
: The name of the function to which this variable belongs.range
: The TextRange that points to the definition itself (i.e., the import statement).
§Returns
A new VarEntry that has the given function set but not yet any type information populated.
sourcepub fn from_prop<S1: Into<String>, D: Into<DataType>, S2: Into<String>>(
name: S1,
data_type: D,
class: S2,
range: TextRange,
) -> Self
pub fn from_prop<S1: Into<String>, D: Into<DataType>, S2: Into<String>>( name: S1, data_type: D, class: S2, range: TextRange, ) -> Self
Creates a VarEntry as if it was a property of a class.
§Generic arguments
S1
: The String-like type of the variable’sname
.D
: The DataType-like type of thedata_type
.S2
: The String-like type of theclass
.
§Arguments
name
: The name of the VarEntry.data_type
: The DataType of this property.class
: The name of the class to which this variable belongs.range
: The TextRange that points to the definition itself (i.e., the import statement).
§Returns
A new VarEntry that has the given class set but not yet any type information populated.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VarEntry
impl RefUnwindSafe for VarEntry
impl Send for VarEntry
impl Sync for VarEntry
impl Unpin for VarEntry
impl UnwindSafe for VarEntry
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