#[non_exhaustive]pub enum Granularity {
Model,
Batch,
Item,
}Expand description
The level at which a passport describes a product: a model, a production batch, or one physical unit.
§Why this lives in the catalog and not in a port
ESPR Art. 9(2)(d) makes the level a delegated-act decision — “whether the
digital product passport is to be established at model, batch or item level”.
It is therefore a property of the instrument that imposes the passport, and
every consumer downstream is reading that decision rather than making one.
The EU registry is one such consumer, which is why
RegistrationGranularity
exists and converts from this type rather than the other way round.
No Default, deliberately: an act that has not fixed a level is
Option::None on the instrument, not a guess at item level. Defaulting
here would silently answer a question only a delegated act can answer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Model
One passport covering every unit sharing a model’s specifications.
Batch
One passport covering every unit made in one production run.
Item
One passport per physical unit.
Implementations§
Source§impl Granularity
impl Granularity
Sourcepub fn most_granular(self, other: Self) -> Self
pub fn most_granular(self, other: Self) -> Self
The more granular of two levels.
The ordering Model < Batch < Item is the derived Ord, and matches the
rule the EU registry applies: where several levels are indicated for one
product, the most granular wins (IR (EU) 2026/1778 Art. 8(3), and Art.
8(4)–(5) linking an item registration back up to batch and model).
This is why applicable instruments fold to a maximum rather than picking one: two acts naming different levels do not conflict, they compound.
Sourcepub const fn describes_a_type(self) -> bool
pub const fn describes_a_type(self) -> bool
Whether a passport at this level describes a specification rather than manufactured things.
Model covers every unit sharing a model’s
specifications, so it describes a type. Batch and
Item both describe things that were made — one run, or
one unit.
§Why this is answered here
A projection that has to classify the asset it is describing needs it,
and this enum is #[non_exhaustive], so a match from another crate must
carry a wildcard. A wildcard would quietly file a future level as one
answer or the other — and “not stated” is a distinction this type takes
care to preserve elsewhere, so it should not be thrown away here.
Authored beside the variants, the match is exhaustive.
Trait Implementations§
Source§impl Clone for Granularity
impl Clone for Granularity
impl Copy for Granularity
Source§impl Debug for Granularity
impl Debug for Granularity
Source§impl<'de> Deserialize<'de> for Granularity
impl<'de> Deserialize<'de> for Granularity
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>,
impl Eq for Granularity
Source§impl From<Granularity> for RegistrationGranularity
impl From<Granularity> for RegistrationGranularity
Source§fn from(granularity: Granularity) -> Self
fn from(granularity: Granularity) -> Self
The registry registers at the level the applicable act fixed.
Direction matters: Granularity is the
act’s decision under ESPR Art. 9(2)(d), and this type is one consumer of
it. A conversion the other way would let a registry default answer a
question only a delegated act can answer, which is why none exists — and
why this type’s #[default] of Item must never travel back up into the
catalog.
Source§impl Ord for Granularity
impl Ord for Granularity
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Granularity
impl PartialEq for Granularity
Source§impl PartialOrd for Granularity
impl PartialOrd for Granularity
Source§impl Serialize for Granularity
impl Serialize for Granularity
impl StructuralPartialEq for Granularity
Auto Trait Implementations§
impl Freeze for Granularity
impl RefUnwindSafe for Granularity
impl Send for Granularity
impl Sync for Granularity
impl Unpin for Granularity
impl UnsafeUnpin for Granularity
impl UnwindSafe for Granularity
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.