Skip to main content

CliConfigResolver

Struct CliConfigResolver 

Source
#[repr(C)]
pub struct CliConfigResolver { pub base: ConfigResolver, pub default_config: Config, pub config_cache: HashMap<String, Config>, pub config_errors: Vec<(String, String)>, }
Expand description

Port of struct CliConfigResolver : Luau::ConfigResolver (CLI/src/Analyze.cpp:231-321).

Like the analysis ConfigResolver (a struct with a fn-pointer vtable slot for the single pure virtual getConfig), this concrete subclass is #[repr(C)] with base: ConfigResolver first so that a *const ConfigResolver (the vtable receiver) can be cast back to *const CliConfigResolver.

C++ members:

  • Luau::Config defaultConfig;
  • mutable std::unordered_map<std::string, Luau::Config> configCache;
  • mutable std::vector<std::pair<std::string, std::string>> configErrors;

Fields§

§base: ConfigResolver§default_config: Config§config_cache: HashMap<String, Config>§config_errors: Vec<(String, String)>

Implementations§

Source§

impl CliConfigResolver

Source

pub fn cli_config_resolver(mode: Mode) -> Self

C++ CliConfigResolver(Luau::Mode mode) { defaultConfig.mode = mode; } (CLI/src/Analyze.cpp:238-241).

Source§

impl CliConfigResolver

Source

pub fn get_config(&self, name: &ModuleName, limits: &TypeCheckLimits) -> &Config

C++ const Config& getConfig(const ModuleName& name, const TypeCheckLimits& limits) const (CLI/src/Analyze.cpp:243-250).

getConfig is logically const in C++ but mutates the mutable configCache / configErrors members through readConfigRec; the &self receiver is cast to &mut self for those interior mutations, matching the C++ mutable intent.

Source§

impl CliConfigResolver

Source

pub fn read_config_rec( &mut self, path: &str, limits: &TypeCheckLimits, ) -> &Config

C++ const Config& readConfigRec(const std::string& path, const TypeCheckLimits& limits) const (CLI/src/Analyze.cpp:252-320).

Trait Implementations§

Source§

impl Debug for CliConfigResolver

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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.