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<&CaixaVersion> for String
Trait-idiomatic borrowed-input, owned-String output reverse
projection on the CaixaVersion newtype primitive — the
borrowed-input companion to the paired owned-input
[From<CaixaVersion> for String] impl immediately above. Routes
byte-for-byte through the substrate-primitive
CaixaVersion::as_str pub const fn accessor (via
str::to_owned) so every consumer that holds a
borrowed [&CaixaVersion] and needs an owned String — a
[…].iter().map(String::from).collect::<Vec<_>>() per-instance
materializer over &[CaixaVersion] (whose iterator yields
&CaixaVersion, not CaixaVersion, so the owned-input
[From<CaixaVersion> for String] axis alone forces every call site
through an explicit .clone() / dereference restatement), a future
HashMap::<String, _>::from_iter that keys off a borrowed-
iteration axis where cloning the wrapper would allocate one
String beyond the map entry’s own, a future
serde_json::Value::String(String::from(&caixa.versao))
structured-payload composer that owns the emit-path without moving
out of a borrowed field — reaches the wrapped byte-string through
this one dispatch on the substrate primitive.
impl From<&CaixaVersion> for String
Trait-idiomatic borrowed-input, owned-String output reverse
projection on the CaixaVersion newtype primitive — the
borrowed-input companion to the paired owned-input
[From<CaixaVersion> for String] impl immediately above. Routes
byte-for-byte through the substrate-primitive
CaixaVersion::as_str pub const fn accessor (via
str::to_owned) so every consumer that holds a
borrowed [&CaixaVersion] and needs an owned String — a
[…].iter().map(String::from).collect::<Vec<_>>() per-instance
materializer over &[CaixaVersion] (whose iterator yields
&CaixaVersion, not CaixaVersion, so the owned-input
[From<CaixaVersion> for String] axis alone forces every call site
through an explicit .clone() / dereference restatement), a future
HashMap::<String, _>::from_iter that keys off a borrowed-
iteration axis where cloning the wrapper would allocate one
String beyond the map entry’s own, a future
serde_json::Value::String(String::from(&caixa.versao))
structured-payload composer that owns the emit-path without moving
out of a borrowed field — reaches the wrapped byte-string through
this one dispatch on the substrate primitive.
Second corner on the {Self, &Self} → String reverse-projection
family opened on the paired owned-input
[From<CaixaVersion> for String] impl immediately above. Rust’s
From trait does not derive the From<&Self> sibling from a
From<Self> impl (the blanket
impl<T, U> From<&T> for U where T: Clone, U: From<T> does not
exist in core), so every newtype that carries the owned-input
reverse axis but not the borrowed-input axis forces every borrowed
call site through a .clone() / <String>::from(v.clone()) detour
whose type bounds have no compile-time link back to the newtype.
Pinned load-bearing by
[tests::caixa_version_from_borrowed_into_owned_string_routes_through_as_str_accessor]
(byte-parity pin against CaixaVersion::as_str via a borrowed
input) and
[tests::caixa_version_from_owned_and_borrowed_into_string_agree_on_every_shape]
(cross-axis partition pin against the paired owned-input
[From<CaixaVersion> for String] impl on the same instance,
closing the “owned-input move vs. borrowed-input clone” bifurcation
on the same wrapped body).
Source§fn from(v: &CaixaVersion) -> String
fn from(v: &CaixaVersion) -> String
Source§impl From<&str> for CaixaVersion
impl From<&str> for CaixaVersion
Source§impl From<CaixaVersion> for String
Trait-idiomatic owned-String reverse projection on the
CaixaVersion newtype primitive — the owned-heap-string inverse
of the pre-existing [From<String> for CaixaVersion] /
[From<&str> for CaixaVersion] forward-projection pair on this
primitive. Returns the wrapped String verbatim ([Self::0],
a move of the pre-existing heap allocation — no re-copy of the
per-instance version body’s bytes), so every consumer that binds a
CaixaVersion through the standard-library .into() /
[From<Self> for String] (equivalently Into<String>) axis
reaches the wrapped byte-string through one substrate-primitive
dispatch rather than through a .as_str().to_owned() /
.to_string() allocating detour whose bounds have no compile-time
link back to the newtype’s storage.
impl From<CaixaVersion> for String
Trait-idiomatic owned-String reverse projection on the
CaixaVersion newtype primitive — the owned-heap-string inverse
of the pre-existing [From<String> for CaixaVersion] /
[From<&str> for CaixaVersion] forward-projection pair on this
primitive. Returns the wrapped String verbatim ([Self::0],
a move of the pre-existing heap allocation — no re-copy of the
per-instance version body’s bytes), so every consumer that binds a
CaixaVersion through the standard-library .into() /
[From<Self> for String] (equivalently Into<String>) axis
reaches the wrapped byte-string through one substrate-primitive
dispatch rather than through a .as_str().to_owned() /
.to_string() allocating detour whose bounds have no compile-time
link back to the newtype’s storage.
A future consumer that wants to unwrap a CaixaVersion into an
owned String — a serde_json::Value::String(versao.into())
structured-payload composer where the Value::String arm typing
demands an owned String and the sibling
AsRef<str>-borrowed axis forces an explicit .to_owned()
restatement at every call site, a future
HashMap::<String, _>::from_iter([(versao.into(), _)]) per-versao
lookup where the map’s key type is owned String rather than
&str borrowed from a stashed CaixaVersion, a future
Cow::<'static, str>::Owned(versao.into()) composer where the
owned arm typing rules out the borrowed AsRef<str> return —
reaches the wrapped String through this one dispatch, avoiding
the pre-lift double-allocation (.as_str().to_owned() on the owned
path would allocate a fresh String rather than reuse the
wrapper’s own heap allocation).
Opens the trait-idiomatic owned-String reverse-projection axis
on the substrate’s core String-wrapper newtype primitive
CaixaVersion, mirroring the paired owned-String forward-
projection family the sibling closed-set fieldless typed enums
(crate::supervisor::RestartStrategy (7baa18a, first-mover),
crate::supervisor::RestartPolicy (7851725),
crate::CaixaKind (per its own doc block, third peer), plus the
remaining twelve closed-set enums) already carry — Rust’s standard
library does not derive From<Self> for String from From<String> for Self, so every newtype that carries a forward From<String>
constructor but not the paired reverse-unwrap axis forces every
call site through a .to_string() / .as_str().to_owned() detour
that allocates fresh bytes rather than moving the wrapper’s own
heap allocation.
Preserves the two-path split on the wrapped byte-string: the paired
AsRef<str> and fmt::Display impls stay reachable for the
borrowed &str and formatter-output paths, this impl closes the
owned-String reverse axis. Same “one dispatch on the substrate
primitive” discipline the peer forward From<String> for CaixaVersion / From<&str> for CaixaVersion constructors carry,
now extended onto the owned-heap-string reverse projection.
Pinned load-bearing by
[tests::caixa_version_from_into_owned_string_returns_wrapped_body]
(byte-parity pin against CaixaVersion::as_str on the same
instance) and
[tests::caixa_version_from_into_owned_string_and_as_str_agree_on_every_shape]
(cross-axis partition pin against the paired borrowed
AsRef<str> impl and the sibling fmt::Display-routed
ToString::to_string surface, plus a round-trip witness through
the paired forward [From<String> for CaixaVersion] constructor
closing the two-way Self → String → Self cycle by construction).
Source§fn from(v: CaixaVersion) -> String
fn from(v: CaixaVersion) -> String
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.