Skip to main content

FValue

Struct FValue 

Source
pub struct FValue<T> { /* private fields */ }

Implementations§

Source§

impl<T: Copy> FValue<T>

Source

pub const fn new(name: *const c_char, def: T, dynamic: bool) -> Self

Source§

impl<T: Copy> FValue<T>

Source

pub fn get_global(&self) -> T

Source§

impl<T: FValueOverridable> FValue<T>

Source

pub fn get(&self) -> T

Source§

impl<T: FValueOverridable> FValue<T>

Source

pub fn push_test_override(&self, value: T)

Install a thread-local override for this flag (used by the test scope guard ScopedFValue). Visible only to the current thread until popped.

Source

pub fn pop_test_override(&self)

Remove the most recent thread-local override for this flag.

Source§

impl<T: Copy> FValue<T>

Source

pub fn set(&self, value: T)

Runtime flag set (the CLI/host path mutates the public value field).

Source

pub fn version(&self) -> c_uint

Current version (0 unless a LUAU_FLAGVERSION setter ran).

Source§

impl<T: FValueList> FValue<T>

Source

pub unsafe fn register(&'static self)

The C++ ctor side effect next = list; list = this;. Call once, on the flag’s 'static instance, after construction.

§Safety

Must be called at most once per flag, before any concurrent list walk (registration is single-threaded startup work, as in C++).

Source§

impl<T: FValueList + Copy + 'static> FValue<T>

Source

pub fn set_value_by_name(name: &str, value: T)

Walk the per-type FValue<T>::list and set every flag whose name matches to value (the C++ test harness setFastValue<T>(name, value) in tests/main.cpp). Configured at startup before worker threads — the same single-threaded contract as flag construction.

Source

pub fn set_all_unless(value: T, skip: impl Fn(&str) -> bool)

Walk the per-type FValue<T>::list and set every flag to value unless the host-supplied skip predicate (matched on the flag’s UTF-8 name) returns true. Models the bool --fflags=true|false branch of the C++ test harness setFastFlags, which sets every non-skipped flag. Startup- only, single-threaded — the same contract as flag construction.

Trait Implementations§

Source§

impl<T: Sync> Sync for FValue<T>

Auto Trait Implementations§

§

impl<T> !Freeze for FValue<T>

§

impl<T> !RefUnwindSafe for FValue<T>

§

impl<T> !Send for FValue<T>

§

impl<T> !UnwindSafe for FValue<T>

§

impl<T> Unpin for FValue<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for FValue<T>
where T: UnsafeUnpin,

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.