pub struct SymbolTable { /* private fields */ }
Implementations§
Source§impl SymbolTable
impl SymbolTable
pub fn internal_functions(&self) -> Vec<Rc<InternalFunctionDefinition>>
Source§impl SymbolTable
impl SymbolTable
pub fn module_path(&self) -> Vec<String>
Source§impl SymbolTable
impl SymbolTable
pub fn new(module_path: &[String]) -> SymbolTable
pub fn is_empty(&self) -> bool
pub const fn symbols(&self) -> &SeqMap<String, Symbol>
pub fn structs(&self) -> SeqMap<String, NamedStructType>
Sourcepub fn extend_from(
&mut self,
symbol_table: &SymbolTable,
) -> Result<(), SemanticError>
pub fn extend_from( &mut self, symbol_table: &SymbolTable, ) -> Result<(), SemanticError>
§Errors
Sourcepub fn extend_basic_from(
&mut self,
symbol_table: &SymbolTable,
) -> Result<(), SemanticError>
pub fn extend_basic_from( &mut self, symbol_table: &SymbolTable, ) -> Result<(), SemanticError>
§Errors
Sourcepub fn extend_alias_from(
&mut self,
symbol_table: &SymbolTable,
) -> Result<(), SemanticError>
pub fn extend_alias_from( &mut self, symbol_table: &SymbolTable, ) -> Result<(), SemanticError>
§Errors
pub fn extend_intrinsic_functions_from( &mut self, symbol_table: &SymbolTable, ) -> Result<(), SemanticError>
pub fn get_package_version(&self, name: &str) -> Option<String>
Sourcepub fn add_constant(
&mut self,
constant: Constant,
) -> Result<Rc<Constant>, SemanticError>
pub fn add_constant( &mut self, constant: Constant, ) -> Result<Rc<Constant>, SemanticError>
§Errors
Sourcepub fn add_constant_link(
&mut self,
constant_ref: Rc<Constant>,
) -> Result<(), SemanticError>
pub fn add_constant_link( &mut self, constant_ref: Rc<Constant>, ) -> Result<(), SemanticError>
§Errors
Sourcepub fn add_alias(
&mut self,
alias_type: AliasType,
) -> Result<AliasType, SemanticError>
pub fn add_alias( &mut self, alias_type: AliasType, ) -> Result<AliasType, SemanticError>
§Errors
Sourcepub fn add_alias_link(
&mut self,
alias_type_ref: AliasType,
) -> Result<(), SemanticError>
pub fn add_alias_link( &mut self, alias_type_ref: AliasType, ) -> Result<(), SemanticError>
§Errors
Sourcepub fn add_blueprint(
&mut self,
blueprint: ParameterizedTypeBlueprint,
) -> Result<ParameterizedTypeBlueprint, SemanticError>
pub fn add_blueprint( &mut self, blueprint: ParameterizedTypeBlueprint, ) -> Result<ParameterizedTypeBlueprint, SemanticError>
§Errors
Sourcepub fn add_blueprint_link(
&mut self,
blueprint_ref: ParameterizedTypeBlueprint,
) -> Result<(), SemanticError>
pub fn add_blueprint_link( &mut self, blueprint_ref: ParameterizedTypeBlueprint, ) -> Result<(), SemanticError>
§Errors
pub fn get_blueprint(&self, name: &str) -> Option<&ParameterizedTypeBlueprint>
Sourcepub fn add_type_generator(
&mut self,
name: &str,
type_generator: TypeGenerator,
) -> Result<TypeGenerator, SemanticError>
pub fn add_type_generator( &mut self, name: &str, type_generator: TypeGenerator, ) -> Result<TypeGenerator, SemanticError>
§Errors
Sourcepub fn add_type_generator_link(
&mut self,
name: &str,
type_generator: TypeGenerator,
) -> Result<(), SemanticError>
pub fn add_type_generator_link( &mut self, name: &str, type_generator: TypeGenerator, ) -> Result<(), SemanticError>
§Errors
pub fn get_type_generator(&self, name: &str) -> Option<&TypeGenerator>
pub fn add_external_type( &mut self, external: ExternalType, ) -> Result<ExternalType, SemanticError>
Sourcepub fn add_external_type_link(
&mut self,
external_type_ref: ExternalType,
) -> Result<(), SemanticError>
pub fn add_external_type_link( &mut self, external_type_ref: ExternalType, ) -> Result<(), SemanticError>
§Errors
Sourcepub fn add_struct(
&mut self,
struct_type: NamedStructType,
) -> Result<NamedStructType, SemanticError>
pub fn add_struct( &mut self, struct_type: NamedStructType, ) -> Result<NamedStructType, SemanticError>
§Errors
Sourcepub fn add_generated_struct(
&mut self,
name: &str,
fields: &[(&str, Type)],
) -> Result<NamedStructType, SemanticError>
pub fn add_generated_struct( &mut self, name: &str, fields: &[(&str, Type)], ) -> Result<NamedStructType, SemanticError>
§Errors
Sourcepub fn add_struct_link(
&mut self,
struct_type_ref: NamedStructType,
) -> Result<(), SemanticError>
pub fn add_struct_link( &mut self, struct_type_ref: NamedStructType, ) -> Result<(), SemanticError>
§Errors
pub fn add_enum_type( &mut self, enum_type: EnumType, ) -> Result<(), SemanticError>
pub fn add_enum_type_link( &mut self, enum_type_ref: EnumType, ) -> Result<(), SemanticError>
pub fn add_internal_function( &mut self, name: &str, function: InternalFunctionDefinition, ) -> Result<Rc<InternalFunctionDefinition>, SemanticError>
pub fn add_internal_function_link( &mut self, name: &str, function_ref: Rc<InternalFunctionDefinition>, ) -> Result<(), SemanticError>
pub fn get_symbol(&self, name: &str) -> Option<&Symbol>
pub fn add_symbol( &mut self, name: &str, symbol: Symbol, ) -> Result<(), SemanticError>
pub fn get_type(&self, name: &str) -> Option<&Type>
pub fn get_struct(&self, name: &str) -> Option<&NamedStructType>
pub fn get_enum(&self, name: &str) -> Option<&EnumType>
pub fn get_enum_variant_type( &self, enum_type_name: &str, variant_name: &str, ) -> Option<EnumVariantType>
pub fn get_constant(&self, name: &str) -> Option<&Rc<Constant>>
pub fn get_function(&self, name: &str) -> Option<&FuncDef>
pub fn get_internal_function( &self, name: &str, ) -> Option<&Rc<InternalFunctionDefinition>>
pub fn get_intrinsic_function( &self, name: &str, ) -> Option<&Rc<IntrinsicFunctionDefinition>>
pub fn get_external_function_declaration( &self, name: &str, ) -> Option<&Rc<ExternalFunctionDefinition>>
pub fn get_external_type(&self, name: &str) -> Option<&ExternalType>
pub fn add_external_function_declaration( &mut self, decl: ExternalFunctionDefinition, ) -> Result<Rc<ExternalFunctionDefinition>, SemanticError>
pub fn add_external_function_declaration_link( &mut self, decl_ref: Rc<ExternalFunctionDefinition>, ) -> Result<(), SemanticError>
pub fn add_module_link( &mut self, name: &str, ns: Rc<Module>, ) -> Result<(), SemanticError>
pub fn get_module_link(&self, name: &str) -> Option<&Rc<Module>>
pub fn add_package_version( &mut self, name: &str, version: TinyVersion, ) -> Result<(), SemanticError>
pub fn add_intrinsic_function( &mut self, function: IntrinsicFunctionDefinition, ) -> Result<Rc<IntrinsicFunctionDefinition>, SemanticError>
Trait Implementations§
Source§impl Clone for SymbolTable
impl Clone for SymbolTable
Source§fn clone(&self) -> SymbolTable
fn clone(&self) -> SymbolTable
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 SymbolTable
impl RefUnwindSafe for SymbolTable
impl !Send for SymbolTable
impl !Sync for SymbolTable
impl Unpin for SymbolTable
impl UnwindSafe for SymbolTable
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§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> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);