pub struct CaixaVersion(pub String);Expand description
A caixa’s pinned version — a thin typed wrapper over a String that parses
as semver::Version on demand.
Stored as a String at rest so authoring a caixa.lisp stays a single
quoted literal. The typed form is reached through Self::parse.
Tuple Fields§
§0: StringImplementations§
Trait Implementations§
Source§impl AsRef<str> for CaixaVersion
Substrate-canonical AsRef<str> projection on the CaixaVersion
typed newtype — routes through the same CaixaVersion::as_str
pub const fn scalar accessor the sibling fmt::Display impl
and every downstream &str-shaped consumer already keys off, so
any future consumer that binds a CaixaVersion through the
standard-library impl AsRef<str> bound (a Path-shaped file-
system reader on the operator side that accepts the version body
as one segment of a per-caixa versao/<v>/... on-disk cache path,
a builder-shaped API on the future feira publish writer verb
that composes <prefix><versao> through a git-tag builder crate’s
impl AsRef<str> join step, a HashMap<CaixaVersion, _> lookup
through the map.get::<str>(v.as_ref()) shape a future
version-keyed dispatch table lands on) reaches the wrapped
String through one substrate-primitive dispatch rather than
through the pre-lift .as_str() open-coded projection at every
wire-up.
impl AsRef<str> for CaixaVersion
Substrate-canonical AsRef<str> projection on the CaixaVersion
typed newtype — routes through the same CaixaVersion::as_str
pub const fn scalar accessor the sibling fmt::Display impl
and every downstream &str-shaped consumer already keys off, so
any future consumer that binds a CaixaVersion through the
standard-library impl AsRef<str> bound (a Path-shaped file-
system reader on the operator side that accepts the version body
as one segment of a per-caixa versao/<v>/... on-disk cache path,
a builder-shaped API on the future feira publish writer verb
that composes <prefix><versao> through a git-tag builder crate’s
impl AsRef<str> join step, a HashMap<CaixaVersion, _> lookup
through the map.get::<str>(v.as_ref()) shape a future
version-keyed dispatch table lands on) reaches the wrapped
String through one substrate-primitive dispatch rather than
through the pre-lift .as_str() open-coded projection at every
wire-up.
Peer of the sibling fmt::Display impl on the same primitive —
both delegate to the shared CaixaVersion::as_str pub const fn accessor, so [format!("{v}")], v.as_str(), and
<CaixaVersion as AsRef<str>>::as_ref(&v) resolve to the same
byte-string per instance by construction. A future rebrand of the
wrapped storage (a hypothetical widening to a typed semver::Version
slot the roadmap acknowledges once eager parse-on-construct
discipline lands, an internal normalization step that trims
leading zeroes off pre-release identifiers, a per-cluster overlay
the operator pins through a future :versao-overrides slot) that
changes what CaixaVersion::as_str returns migrates every
consumer of every one of the three paths in lockstep.
Same “route the trait impl through the substrate-primitive
accessor” discipline the sibling fmt::Display impl on this
type already carries — extends it onto the standard-library
AsRef<str> projection axis every third-party API that takes
impl AsRef<str> (the std::path::Path::new / std::fs
interop surface, std::process::Command::arg, the peer
tracing::field::Value recorder’s Str-arm, every clap-side
value_parser! fold that accepts an owned newtype through
impl AsRef<str>) already binds through. Rust-side newtype
convention pairs AsRef<str> and fmt::Display on the same
primitive so a caller who has one has both; before this lift,
CaixaVersion carried fmt::Display but not the paired
AsRef<str> impl the convention names.
The first standard-library trait added to CaixaVersion beyond
the pre-existing serde::Serialize / serde::Deserialize /
Debug / Clone / PartialEq / Eq / Hash derives
and the paired fmt::Display / From<String> / From<&str>
hand-written impls. Pinned load-bearing by
[tests::caixa_version_as_ref_str_routes_through_as_str_accessor]
(byte-parity pin against CaixaVersion::as_str) — any future
silent detour that routes the impl through a divergent projection
(a Cow<'_, str> intermediate, a stray .to_lowercase()
normalization, a swap onto a per-arm inline &self.0.as_str()
re-inlining) trips at caixa-core test time under assert_eq!
rather than at a downstream impl AsRef<str>-bound consumer’s
silent split.
Source§impl Clone for CaixaVersion
impl Clone for CaixaVersion
Source§fn clone(&self) -> CaixaVersion
fn clone(&self) -> CaixaVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CaixaVersion
impl Debug for CaixaVersion
Source§impl<'de> Deserialize<'de> for CaixaVersion
impl<'de> Deserialize<'de> for CaixaVersion
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>,
Source§impl Display for CaixaVersion
impl Display for CaixaVersion
impl Eq for CaixaVersion
Source§impl From<&str> for CaixaVersion
impl From<&str> for CaixaVersion
Source§impl From<String> for CaixaVersion
impl From<String> for CaixaVersion
Source§impl Hash for CaixaVersion
impl Hash for CaixaVersion
Source§impl PartialEq for CaixaVersion
impl PartialEq for CaixaVersion
Source§impl Serialize for CaixaVersion
impl Serialize for CaixaVersion
impl StructuralPartialEq for CaixaVersion
Auto Trait Implementations§
impl Freeze for CaixaVersion
impl RefUnwindSafe for CaixaVersion
impl Send for CaixaVersion
impl Sync for CaixaVersion
impl Unpin for CaixaVersion
impl UnsafeUnpin for CaixaVersion
impl UnwindSafe for CaixaVersion
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§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.