pub struct CollectionDef {
pub name: CapName,
pub docs: String,
}Expand description
A collection declaration. A collection is a name for a set of
capabilities that any feature may add to, such as the standard features’
flm.validated (VALIDATED), which every
check of the standard features joins.
Demanding a collection demands every one of its members. A feature uses a
collection to join a set of demands it does not own: it declares its own
check capability and adds it as a member with
FeatureBuilder::collection_member,
and a caller that demands the collection then runs that check too.
Collections share one namespace with capabilities and tables, so a
collection’s name may not be a capability’s or a table’s. A collection can
be demanded but never provided: a stage that lists a collection in its
provides is a build error (BuildError::CollectionAsCapability).
Register the declaration with
FeatureBuilder::collection.
It is written to data with Serialize; see serialized
forms.
§Examples
use flm_core::core::registry::CollectionDef;
let def = CollectionDef::new("flm.validated").docs("Every registered check has run.");
assert_eq!(def.name, "flm.validated");Fields§
§name: CapNameThe collection’s name, in the namespace that capabilities and tables share.
docs: StringDocumentation prose.
Implementations§
Source§impl CollectionDef
impl CollectionDef
Sourcepub fn new(name: impl Into<CapName>) -> CollectionDef
pub fn new(name: impl Into<CapName>) -> CollectionDef
A collection called name, with no documentation. Any feature adds
members separately, with
FeatureBuilder::collection_member.
Sourcepub fn docs(self, docs: impl Into<String>) -> CollectionDef
pub fn docs(self, docs: impl Into<String>) -> CollectionDef
Sets the documentation prose. Returns self, for chaining.
Trait Implementations§
Source§impl Clone for CollectionDef
impl Clone for CollectionDef
Source§impl Debug for CollectionDef
impl Debug for CollectionDef
impl Eq for CollectionDef
Source§impl JsonSchema for CollectionDef
impl JsonSchema for CollectionDef
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 CollectionDef
impl PartialEq for CollectionDef
Source§impl Serialize for CollectionDef
impl Serialize for CollectionDef
impl StructuralPartialEq for CollectionDef
Auto Trait Implementations§
impl Forget for CollectionDef
impl Freeze for CollectionDef
impl Move for CollectionDef
impl RefUnwindSafe for CollectionDef
impl Send for CollectionDef
impl Sync for CollectionDef
impl Unpin for CollectionDef
impl UnsafeUnpin for CollectionDefwhere
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for CollectionDef
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