Skip to main content

Settings

Struct Settings 

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

An immutable description of a builder’s or interpreter’s configuration.

Read this through crate::RustiaBuilder::settings before construction or crate::Rustia::settings afterward. Configure the interpreter through its builder.

identity_bytes also covers internal settings that applications cannot configure. It is useful when binding a replay or a script package to an exact configuration.

Implementations§

Source§

impl Settings

Source

pub const fn profile(&self) -> Profile

Returns the selected language compatibility and host capability policy.

Source

pub const fn guest_surface(&self) -> GuestSurface

Returns the script environment selected by the execution preset.

Source

pub const fn fuel(&self) -> Option<u64>

Returns the instruction-fuel ceiling, or None when unlimited.

Source

pub const fn recursion_limit(&self) -> usize

Returns the maximum script call depth.

Source

pub const fn memory_limit_bytes(&self) -> Option<usize>

Returns the logical-live script memory limit, or None when unlimited.

Source

pub const fn memory_tracking(&self) -> bool

Returns whether instruction-boundary memory peaks are recorded.

Source

pub const fn diagnostic_limits(&self) -> DiagnosticLimits

Returns the separate host-side error reporting budgets.

Source

pub const fn runtime_compilation(&self) -> bool

Returns whether scripts may compile more code through loadstring.

Source

pub const fn stdout(&self) -> bool

Returns whether print has a host output sink.

Source

pub const fn wall_clock(&self) -> Option<ServiceDeterminism>

Returns the wall-clock provider’s declaration, or None for the default.

Source

pub const fn monotonic_clock(&self) -> Option<ServiceDeterminism>

Returns the monotonic-clock declaration, or None for the logical clock.

Source

pub const fn entropy(&self) -> Option<ServiceDeterminism>

Returns the seed provider’s declaration, or None for the zero seed.

Source

pub const fn module_resolver(&self) -> Option<ServiceDeterminism>

Returns the module resolver’s declaration, or None when absent.

Source

pub fn identity_bytes(&self) -> &[u8] ⓘ

Returns canonical, versioned bytes describing the effective settings.

The bytes cover the profile, guest surface, every resource and reporting limit, internal execution options, runtime-compiler presence, and host provider presence and reproducibility declarations. Integers have fixed widths and little-endian encoding, independent of the machine’s pointer width. Treat the result as opaque; a new encoding version may change it.

This does not identify source code, the Rustia build, callback or provider implementations, captured data, resolved modules, or returned clock and entropy values. Bind those separately when constructing a replay or package identity. Reading these bytes never calls a host provider.

Trait Implementations§

Source§

impl Clone for Settings

Source§

fn clone(&self) -> Settings

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Settings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Settings

Source§

fn eq(&self, other: &Settings) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Settings

Source§

impl StructuralPartialEq for Settings

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.