pub struct FleetCompositionProposal {
pub ratification: RatificationState,
pub suggestions: Vec<RoleSuggestion>,
pub advisory: String,
}Expand description
A composition proposal: suggestions plus the fact that nobody has agreed.
Fields§
§ratification: RatificationStateAlways RatificationState::Unratified as produced here.
suggestions: Vec<RoleSuggestion>One suggestion per requested role.
advisory: StringThe banner a UI must show. Present in the value itself so a surface cannot render the suggestions without it being obvious what they are.
Implementations§
Source§impl FleetCompositionProposal
impl FleetCompositionProposal
Sourcepub fn validate(
request: &FleetCompositionRequest,
suggestions: Vec<RoleSuggestion>,
) -> Result<Self, CompositionError>
pub fn validate( request: &FleetCompositionRequest, suggestions: Vec<RoleSuggestion>, ) -> Result<Self, CompositionError>
Validate a set of suggestions against the request that produced them.
Every suggestion must name a role that was asked for and a provider/model that is in the pool. A model outside the pool is an error, never a substitution: silently swapping in something the operator did not configure is the exact failure this whole schema exists to prevent.
Sourcepub const fn is_actionable(&self) -> bool
pub const fn is_actionable(&self) -> bool
Whether this proposal may be acted on automatically. Always false.
A constant rather than a field lookup, so no future edit can make a proposal self-executing by flipping a boolean somewhere.
Sourcepub fn unfilled_roles(&self, request: &FleetCompositionRequest) -> Vec<String>
pub fn unfilled_roles(&self, request: &FleetCompositionRequest) -> Vec<String>
Roles the request asked for that no suggestion covers.
Trait Implementations§
Source§impl Clone for FleetCompositionProposal
impl Clone for FleetCompositionProposal
Source§fn clone(&self) -> FleetCompositionProposal
fn clone(&self) -> FleetCompositionProposal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more