pub struct ReadScopeSpec {
pub name: &'static str,
pub options: &'static [OptionSpec],
}Expand description
The named scope options a reader accepts. Examples document values; they never fill a choice.
Fields§
§name: &'static strThe reader’s stable name, independent of an application’s source aliases.
options: &'static [OptionSpec]Required choices, one-of groups, or optional values with a stated meaning for absence.
Implementations§
Source§impl ReadScopeSpec
impl ReadScopeSpec
Sourcepub fn check(&self, choices: &Options) -> Result<(), String>
pub fn check(&self, choices: &Options) -> Result<(), String>
Check caller choices using the same declarations and rules as registered pass options.
Sourcepub fn resolve(&self, choices: Options) -> Result<ReadScope, String>
pub fn resolve(&self, choices: Options) -> Result<ReadScope, String>
Retain the caller’s exact choices. Missing required values are refused, not inferred.
Sourcepub fn record_unloaded(
&self,
scope: &mut ReadScope,
option: &str,
value: &str,
source: impl Into<String>,
) -> Result<(), String>
pub fn record_unloaded( &self, scope: &mut ReadScope, option: &str, value: &str, source: impl Into<String>, ) -> Result<(), String>
Record a source alternative that was not loaded under this scope, without inventing payload.
source is its source identity (a member, prototype or named family), not a local machine path.
Trait Implementations§
Source§impl Clone for ReadScopeSpec
impl Clone for ReadScopeSpec
impl Copy for ReadScopeSpec
Auto Trait Implementations§
impl Forget for ReadScopeSpec
impl Freeze for ReadScopeSpec
impl RefUnwindSafe for ReadScopeSpec
impl Send for ReadScopeSpec
impl Sync for ReadScopeSpec
impl Unpin for ReadScopeSpec
impl UnsafeUnpin for ReadScopeSpec
impl UnwindSafe for ReadScopeSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more