pub struct TwinFamilyManifest {
pub family_id: String,
pub common_name: String,
pub classification: String,
pub variants: Vec<ModelVariantDescriptor>,
pub default_variant: String,
}Expand description
Family manifest describing a biological taxon or constructed asset family.
Fields§
§family_id: StringStable URN or IRI (e.g. "urn:taxon:phascolarctos_cinereus").
common_name: StringCommon or trade name (e.g. "Koala" or "Centrifugal Pump V2").
classification: StringTaxonomic or asset domain classification ("fauna", "flora", "funga", "machinery", "vehicle").
variants: Vec<ModelVariantDescriptor>Set of declared model variants.
default_variant: StringVariant ID to select when no specific criteria are specified.
Implementations§
Source§impl TwinFamilyManifest
impl TwinFamilyManifest
Sourcepub fn new(
family_id: impl Into<String>,
common_name: impl Into<String>,
classification: impl Into<String>,
default_variant: impl Into<String>,
) -> Self
pub fn new( family_id: impl Into<String>, common_name: impl Into<String>, classification: impl Into<String>, default_variant: impl Into<String>, ) -> Self
Create an empty family manifest; variants are added with
Self::add_variant and default_variant selects the fallback.
Sourcepub fn add_variant(&mut self, variant: ModelVariantDescriptor)
pub fn add_variant(&mut self, variant: ModelVariantDescriptor)
Add a model variant to the family manifest.
Sourcepub fn resolve_variant(
&self,
phenotype: BiologicalPhenotype,
stage: LifecycleStage,
lod: LodTier,
state: StructuralState,
) -> Option<&ModelVariantDescriptor>
pub fn resolve_variant( &self, phenotype: BiologicalPhenotype, stage: LifecycleStage, lod: LodTier, state: StructuralState, ) -> Option<&ModelVariantDescriptor>
Resolve the most appropriate model variant using a principled fallback policy:
- Exact match on
(phenotype, stage, lod, state) - Match on
(phenotype, stage, state)with closest available LOD tier - Fallback to
Monomorphicif sexual dimorphism variant is missing - Fallback to
default_variant
Sourcepub fn encode_to_cbor(&self) -> Result<Vec<u8>, BundleError>
pub fn encode_to_cbor(&self) -> Result<Vec<u8>, BundleError>
Serialise the family manifest to CBOR bytes.
Sourcepub fn decode_from_cbor(bytes: &[u8]) -> Result<Self, BundleError>
pub fn decode_from_cbor(bytes: &[u8]) -> Result<Self, BundleError>
Deserialise a family manifest from CBOR bytes.
Trait Implementations§
Source§impl Clone for TwinFamilyManifest
impl Clone for TwinFamilyManifest
Source§impl Debug for TwinFamilyManifest
impl Debug for TwinFamilyManifest
Source§impl<'de> Deserialize<'de> for TwinFamilyManifest
impl<'de> Deserialize<'de> for TwinFamilyManifest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TwinFamilyManifest
Source§impl PartialEq for TwinFamilyManifest
impl PartialEq for TwinFamilyManifest
Source§impl Serialize for TwinFamilyManifest
impl Serialize for TwinFamilyManifest
impl StructuralPartialEq for TwinFamilyManifest
Auto Trait Implementations§
impl Freeze for TwinFamilyManifest
impl RefUnwindSafe for TwinFamilyManifest
impl Send for TwinFamilyManifest
impl Sync for TwinFamilyManifest
impl Unpin for TwinFamilyManifest
impl UnsafeUnpin for TwinFamilyManifest
impl UnwindSafe for TwinFamilyManifest
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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