Skip to main content

FileNavigationContext

Struct FileNavigationContext 

Source
pub struct FileNavigationContext { /* private fields */ }
Expand description

Port of struct FileNavigationContext : Luau::Require::NavigationContext (CLI/include/Luau/AnalyzeRequirer.h).

The C++ : NavigationContext base relationship is expressed in Rust by implementing luaur_require::records::navigation_context::NavigationContextTrait for this type (see methods/file_navigation_context_navigation_context_trait.rs), rather than by embedding the (non-constructible-from-here) base struct.

Implementations§

Source§

impl FileNavigationContext

Source

pub fn new(requirer_path: String) -> Self

FileNavigationContext::FileNavigationContext(std::string requirerPath) (CLI/src/AnalyzeRequirer.cpp:31-34): requirerPath(std::move(requirerPath)).

Trait Implementations§

Source§

impl NavigationContextTrait for FileNavigationContext

Source§

fn luau_config_init(&self) -> Option<Rc<dyn Fn(*mut lua_State)>>

C++ navigationContext.luauConfigInit = [&info](lua_State* L) { lua_setthreaddata(L, &info); }; (CLI/src/Analyze.cpp:194-197).

Source§

fn luau_config_interrupt( &self, ) -> Option<unsafe extern "C-unwind" fn(l: *mut lua_State, gc: c_int)>

C++ navigationContext.luauConfigInterrupt = [](lua_State* L, int gc) { ... }; (CLI/src/Analyze.cpp:198-205) — identical body to the config-resolver interrupt.

Source§

fn reset_to_requirer(&mut self) -> NavigateResult

Source§

fn jump_to_alias(&mut self, path: &str) -> NavigateResult

Source§

fn to_parent(&mut self) -> NavigateResult

Source§

fn to_child(&mut self, component: &str) -> NavigateResult

Source§

fn get_config_status(&self) -> ConfigStatus

Source§

fn get_config_behavior(&self) -> ConfigBehavior

Source§

fn get_alias(&self, alias: &str) -> Option<String>

Source§

fn get_config(&self) -> Option<String>

Source§

fn to_alias_override(&mut self, _alias_unprefixed: &str) -> NavigateResult

Source§

fn to_alias_fallback(&mut self, _alias_unprefixed: &str) -> NavigateResult

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.