Skip to main content

InitOptions

Struct InitOptions 

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

phase-427 W9 — rclrs::InitOptions, with the one option it has.

Consumed by Context::from_env and Context::new; None for the domain keeps whatever the environment (hosted) or the bake (freestanding) resolved.

Implementations§

Source§

impl InitOptions

Source

pub const fn new() -> Self

Default options: nothing overridden.

Source

pub const fn with_domain_id(self, domain_id: Option<usize>) -> Self

Override the domain id (Some) or keep the resolved one (None).

usize because that is rclrs’s signature. A value above u32::MAX cannot be a domain id at all; it saturates here and the constructor that consumes the options then rejects it as InitError::DomainIdOutOfRange, which is the loud place — a builder method has no Result to carry the refusal in.

Source

pub fn set_domain_id(&mut self, domain_id: Option<usize>)

The in-place twin of with_domain_id — rclrs has both, and a ported opts.set_domain_id(Some(7)) compiles as written. Same saturation.

Source

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

The domain override, if any.

Option<usize>, which is rclrs’s signature and the same reason with_domain_id takes one. phase-467: this returned Option<u32> — the STORED width — so the two setters spoke rclrs and the getter spoke the field, and a ported let d: Option<usize> = opts.domain_id(); failed on a type nobody chose. The value is still stored as a u32 and with_domain_id’s saturation still applies, so a round trip through u32::MAX + 1 reports u32::MAX; the refusal stays on the consuming constructor (InitError::DomainIdOutOfRange), which is where a Result exists to carry it.

Trait Implementations§

Source§

impl Clone for InitOptions

Source§

fn clone(&self) -> InitOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for InitOptions

Source§

impl Debug for InitOptions

Source§

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

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

impl Default for InitOptions

Source§

fn default() -> InitOptions

Returns the “default value” for a type. Read more
Source§

impl Eq for InitOptions

Source§

impl PartialEq for InitOptions

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for InitOptions

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.