pub struct Composition { /* private fields */ }Expand description
The one composition of descriptor-material providers: every provider that participates, named once.
Structurally non-empty — a composition with no provider is not a composition, it is silence — and duplicate-free by construction.
Implementations§
Source§impl Composition
impl Composition
Sourcepub const fn of_one(provider: Provider) -> Self
pub const fn of_one(provider: Provider) -> Self
One complete composition from its sole provider.
Sourcepub fn declared(providers: Vec<Provider>) -> Result<Self, CompositionError>
pub fn declared(providers: Vec<Provider>) -> Result<Self, CompositionError>
Declare the complete provider set.
The ordinary caller supplies its natural Vec; this guard turns it into the private non-empty bounded representation before any duplicate work begins.
Duplicates are refused rather than deduplicated: silently keeping one of two entries is how a composition stops matching the providers that exist.
§Errors
Returns CompositionError carrying DeclarationError::Absent where no provider was supplied, DeclarationError::Unbounded where the provider set outgrows PROVIDER_LIMIT, then every provider identity declared more than once after the roster is admitted.
Trait Implementations§
Source§impl Clone for Composition
impl Clone for Composition
Source§fn clone(&self) -> Composition
fn clone(&self) -> Composition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more