pub struct OptionDecl {
pub key: OptionKey,
pub bind: Bind,
pub owner: FeatureName,
pub docs: String,
}Expand description
A feature’s declaration of one option type: the type, its binding, the feature that declares it, and its description.
FeatureBuilder::options
creates one; the registry collects them from every feature
(FlmRegistry::options), and
the option values a caller sets are checked against them
(validate_values).
It is written to data with Serialize; see serialized
forms.
Fields§
§key: OptionKeyThe option type declared.
bind: BindThe binding: where values for the option type may be set.
owner: FeatureNameThe feature that declares the option type and owns it.
docs: StringA description of what the option type sets, for a person who reads the
registry’s declarations
(FlmRegistry::options);
empty unless the feature gave one
(FeatureBuilder::options_with_docs).
Implementations§
Source§impl OptionDecl
impl OptionDecl
Sourcepub fn of<T: Options>(owner: impl Into<FeatureName>, bind: Bind) -> OptionDecl
pub fn of<T: Options>(owner: impl Into<FeatureName>, bind: Bind) -> OptionDecl
The declaration of the option type T by the feature owner, with the
binding bind and an empty description.
Sourcepub fn named(
name: impl Into<Name>,
owner: impl Into<FeatureName>,
bind: Bind,
) -> OptionDecl
pub fn named( name: impl Into<Name>, owner: impl Into<FeatureName>, bind: Bind, ) -> OptionDecl
The declaration of the option type declared from data under the name
name, by the feature owner, with the binding bind and an empty
description.
Sourcepub fn docs(self, docs: impl Into<String>) -> OptionDecl
pub fn docs(self, docs: impl Into<String>) -> OptionDecl
Builder: sets the description of the option type.
Trait Implementations§
Source§impl Clone for OptionDecl
impl Clone for OptionDecl
Source§impl Debug for OptionDecl
impl Debug for OptionDecl
Source§impl JsonSchema for OptionDecl
impl JsonSchema for OptionDecl
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Forget for OptionDecl
impl Freeze for OptionDecl
impl Move for OptionDecl
impl RefUnwindSafe for OptionDecl
impl Send for OptionDecl
impl Sync for OptionDecl
impl Unpin for OptionDecl
impl UnsafeUnpin for OptionDeclwhere
&'static str: UnsafeUnpin,
*const (): UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for OptionDeclwhere
&'static str: UnwindSafe,
*const (): UnwindSafe,
Arc<str>: UnwindSafe,
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more