pub struct ProducerVersion(/* private fields */);Expand description
The fraiseql build that produced a compiled schema (#1304).
A compiled schema is a build artifact of the release that produced it, and
its meaning is not stable across releases — an absent field is a value the
runtime reads, not a gap it ignores. pagination_order is the worked
example: 2.14 wrote none, 2.15 reads its absence as “this query has no page
order”, so a 2.14 artifact paginates a 2.15 runtime into overlapping pages
under a 200, which is the defect 2.15 shipped to remove. Nothing about
that is visible to an operator.
The stamp is therefore compared, never interpreted: a runtime does not
decide whether some other build’s artifact is close enough, because deciding
that is the judgement #1303 got wrong. What the type buys over the
Option<u32> format version it replaces is that the two producers of a
CompiledSchema can no longer collapse into one value:
- the compiler stamps the build it is part of into the artifact it writes;
- a
CompiledSchemabuilt in process is this build, soDefaultyields it; - an artifact carrying no stamp is
unstamped, a third value — whereNonepreviously meant both “compiled before versioning existed” and “freshly constructed”, and was accepted on the strength of the second reading.
See docs/adr/0020-compiled-schema-build-identity.md.
Implementations§
Source§impl ProducerVersion
impl ProducerVersion
Sourcepub const fn unstamped() -> Self
pub const fn unstamped() -> Self
The value an artifact carrying no fraiseql_version deserializes to.
Reachable only through deserialization: Default is this build, so a
missing JSON key is the one way to obtain it.
Sourcepub fn get(&self) -> Option<&str>
pub fn get(&self) -> Option<&str>
The build named by the stamp, or None when the artifact carries none.
Sourcepub const fn is_unstamped(&self) -> bool
pub const fn is_unstamped(&self) -> bool
Whether the artifact carries no stamp.
Trait Implementations§
Source§impl Clone for ProducerVersion
impl Clone for ProducerVersion
Source§impl Debug for ProducerVersion
impl Debug for ProducerVersion
Source§impl Default for ProducerVersion
impl Default for ProducerVersion
Source§impl<'de> Deserialize<'de> for ProducerVersion
impl<'de> Deserialize<'de> for ProducerVersion
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 ProducerVersion
Source§impl PartialEq for ProducerVersion
impl PartialEq for ProducerVersion
Source§impl Serialize for ProducerVersion
impl Serialize for ProducerVersion
impl StructuralPartialEq for ProducerVersion
Auto Trait Implementations§
impl Freeze for ProducerVersion
impl RefUnwindSafe for ProducerVersion
impl Send for ProducerVersion
impl Sync for ProducerVersion
impl Unpin for ProducerVersion
impl UnsafeUnpin for ProducerVersion
impl UnwindSafe for ProducerVersion
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
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>,
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.