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
impl InitOptions
Sourcepub const fn with_domain_id(self, domain_id: Option<usize>) -> Self
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.
Sourcepub fn set_domain_id(&mut self, domain_id: Option<usize>)
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.
Sourcepub const fn domain_id(&self) -> Option<usize>
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
impl Clone for InitOptions
Source§fn clone(&self) -> InitOptions
fn clone(&self) -> InitOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more