pub struct FeatureInfo {
pub name: FeatureName,
pub title: String,
pub docs: String,
pub version: Option<String>,
}Expand description
The description of a feature that a registry keeps: the feature’s name, title, documentation and optional version.
A feature returns this value from FlmFeature::info. The finished
registry returns it from
FlmRegistry::features and
FlmRegistry::feature after the build,
when the registry no longer holds the feature value.
It is written to data with Serialize; see serialized
forms.
§Examples
use flm_core::core::registry::FeatureInfo;
let info = FeatureInfo::new("refs", "Cross-references")
.docs("Labels, references, and the table that resolves them.")
.version("1.0");
assert_eq!(info.name, "refs");Fields§
§name: FeatureNameThe feature’s registered name, unique within one registry. Every
declaration the feature makes is attributed to this name. By
convention, the names of the entities a feature declares contain it:
the refs feature’s resolve stage is flm.refs.resolve.
title: StringA short human-readable title.
docs: StringDocumentation prose about the feature as a whole.
version: Option<String>A free-form version string, for attribution. It is an input of the registry digest, so two registries whose features differ only in version have different digests, and data cached under one is not read back under the other.
Implementations§
Source§impl FeatureInfo
impl FeatureInfo
Sourcepub fn new(
name: impl Into<FeatureName>,
title: impl Into<String>,
) -> FeatureInfo
pub fn new( name: impl Into<FeatureName>, title: impl Into<String>, ) -> FeatureInfo
The description of the feature name, titled title, with no
documentation and no version.
Sourcepub fn docs(self, docs: impl Into<String>) -> FeatureInfo
pub fn docs(self, docs: impl Into<String>) -> FeatureInfo
Sets the documentation prose. Returns self, for chaining.
Sourcepub fn version(self, version: impl Into<String>) -> FeatureInfo
pub fn version(self, version: impl Into<String>) -> FeatureInfo
Sets the version string. Returns self, for chaining.
Trait Implementations§
Source§impl Clone for FeatureInfo
impl Clone for FeatureInfo
Source§impl Debug for FeatureInfo
impl Debug for FeatureInfo
impl Eq for FeatureInfo
Source§impl JsonSchema for FeatureInfo
impl JsonSchema for FeatureInfo
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 moreSource§impl PartialEq for FeatureInfo
impl PartialEq for FeatureInfo
Source§impl Serialize for FeatureInfo
impl Serialize for FeatureInfo
impl StructuralPartialEq for FeatureInfo
Auto Trait Implementations§
impl Forget for FeatureInfo
impl Freeze for FeatureInfo
impl Move for FeatureInfo
impl RefUnwindSafe for FeatureInfo
impl Send for FeatureInfo
impl Sync for FeatureInfo
impl Unpin for FeatureInfo
impl UnsafeUnpin for FeatureInfowhere
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for FeatureInfo
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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