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 Borrow<str> for CaixaVersion
Trait-idiomatic HashMap-key-shaped borrow projection on the
CaixaVersion newtype primitive — the standard-library
std::borrow::Borrow<str> companion to the paired sibling
AsRef<str> impl (a086 lift) on the same borrow-projection axis of
this primitive. Routes byte-for-byte through the substrate-primitive
CaixaVersion::as_str pub const fn accessor — the same accessor
the paired AsRef<str> and fmt::Display impls already delegate
through — so every consumer that binds a CaixaVersion through the
standard-library Borrow<str> bound reaches the wrapped byte-string
through one substrate-primitive dispatch rather than through a
pre-lift .as_str() open-coded projection at every wire-up.
impl Borrow<str> for CaixaVersion
Trait-idiomatic HashMap-key-shaped borrow projection on the
CaixaVersion newtype primitive — the standard-library
std::borrow::Borrow<str> companion to the paired sibling
AsRef<str> impl (a086 lift) on the same borrow-projection axis of
this primitive. Routes byte-for-byte through the substrate-primitive
CaixaVersion::as_str pub const fn accessor — the same accessor
the paired AsRef<str> and fmt::Display impls already delegate
through — so every consumer that binds a CaixaVersion through the
standard-library Borrow<str> bound reaches the wrapped byte-string
through one substrate-primitive dispatch rather than through a
pre-lift .as_str() open-coded projection at every wire-up.
A future consumer that wants to key a map or set by
CaixaVersion and look up entries by a borrowed &str — a
per-:versao compatibility matrix HashMap<CaixaVersion, PolicyRow>
where the reconciliation loop’s per-cycle .get(current_versao_str)
probes the map with the raw &str view of the current cluster
snapshot’s version body (the HashMap::get<Q: ?Sized> signature is
where K: Borrow<Q>, Q: Hash + Eq; without this impl the caller must
wrap the borrowed &str in a fresh CaixaVersion allocation on
every probe), a future BTreeMap<CaixaVersion, _>::range(..) sweep
over a per-versao index that accepts a borrowed &str range bound
through the same Borrow<str> bound, a
HashSet<CaixaVersion>::contains(&str) membership probe on a
per-versao denylist keyed by owned CaixaVersion but queried by
the borrowed view — reaches the wrapped byte-string through this one
dispatch on the substrate primitive, without the pre-lift
CaixaVersion::from(<&str>) per-probe allocation the paired forward
[From<&str> for CaixaVersion] constructor would otherwise force at
every lookup site.
Peer of the sibling AsRef<str> impl on the same borrow-projection
axis — both project a borrowed &self binding onto a borrowed &str
via the shared substrate-primitive CaixaVersion::as_str accessor.
Rust’s standard library deliberately splits the two trait axes on the
two bounds they carry: AsRef<str> is the conversion bound used
by APIs that accept impl AsRef<str> and view the input as a &str
projection (the std::path::Path::new / std::fs interop
surface, std::process::Command::arg, [clap]-side
value_parser! folds), while std::borrow::Borrow<str> is the
stricter identity bound the collection APIs
(std::collections::HashMap, std::collections::BTreeMap,
std::collections::HashSet, std::collections::BTreeSet) key
their lookup surfaces off — std::borrow::Borrow additionally
promises that a borrowed view produced through [Borrow::borrow]
hashes and compares byte-identically to the owned form, which is the
contract std::collections::HashMap::get relies on when it hashes
the query key through Q (str) and matches against slot keys
hashed through K (CaixaVersion). The CaixaVersion newtype
meets that contract by construction: the derived Hash impl hashes
the wrapped String field, which (through the standard-library
impl Hash for String { fn hash(...) { (**self).hash(...) } }
pass-through) dispatches to [str::hash] on the raw bytes — the same
dispatch a direct .hash() on the &str returned by
[Self::borrow] would take. The derived PartialEq and Eq
impls compare field-wise (byte-equal on the wrapped String), so
cv1 == cv2 reduces to cv1.borrow() == cv2.borrow() at the
&str-projection axis. Both invariants — hash-agrees and
eq-agrees — hold structurally, so this impl is sound under the
std::borrow::Borrow documented safety contract.
Same “one substrate-primitive dispatch, one shared accessor” discipline
the paired AsRef<str> impl on this primitive already carries —
extends it onto the std::borrow::Borrow<str> projection axis the
standard-library collection APIs key their .get::<Q> /
.contains::<Q> / .range::<R, T> / .remove::<Q> lookup surfaces
off. Rust’s standard library mirrors this exact pairing on its own
String primitive (impl AsRef<str> for String +
impl Borrow<str> for String), so a newtype that carries one axis
but not the other splits off the convention that lets every
String-shaped consumer swap the newtype in without re-shaping
its bounds.
Pinned load-bearing by
[tests::caixa_version_borrow_str_routes_through_as_str_accessor]
(byte-parity pin against CaixaVersion::as_str on the same
instance),
[tests::caixa_version_borrow_str_and_as_ref_str_agree_on_every_shape]
(cross-axis partition pin against the paired AsRef<str> impl,
closing the “borrow-axis two-corner split” bifurcation on the same
wrapped body), and
[tests::caixa_version_borrow_str_enables_hashmap_lookup_by_borrowed_key]
(contract-witness pin routing a std::collections::HashMap::get
probe against a &str key through the Borrow<str> bound on a map
keyed by owned CaixaVersion, asserting the collection APIs reach
the same slot the borrowed and owned forms compose the same hash for).
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<&CaixaVersion> for Cow<'static, str>
Trait-idiomatic borrowed-input, std::borrow::Cow<'static, str>
output reverse projection on the CaixaVersion newtype
primitive — the borrowed-input companion to the paired owned-input
[From<CaixaVersion> for std::borrow::Cow<'static, str>] impl
immediately above. Routes byte-for-byte through the
substrate-primitive CaixaVersion::as_str pub const fn
accessor (via str::to_owned wrapped in
std::borrow::Cow::Owned) so every consumer that holds a
borrowed [&CaixaVersion] and needs a [Cow<'static, str>] —
a […].iter().map(Cow::<'static, str>::from).collect::<Vec<_>>()
per-instance materializer over &[CaixaVersion] (whose iterator
yields &CaixaVersion, not CaixaVersion, so the paired
owned-input [From<CaixaVersion> for Cow<'static, str>] axis
alone forces every call site through an explicit .clone() /
dereference restatement), a future
HashMap::<Cow<'static, str>, _>::from_iter that keys off a
borrowed-iteration axis where cloning the wrapper would allocate
one String beyond the eventual [Cow::Owned] arm’s own, a
future generic
<T: for<'a> Into<Cow<'static, str>>>-bound emitter on a
per-caixa diagnostic column that walks the
iter().map(Into::into) shape verbatim — reaches the wrapped
byte-string through this one dispatch on the substrate primitive.
impl From<&CaixaVersion> for Cow<'static, str>
Trait-idiomatic borrowed-input, std::borrow::Cow<'static, str>
output reverse projection on the CaixaVersion newtype
primitive — the borrowed-input companion to the paired owned-input
[From<CaixaVersion> for std::borrow::Cow<'static, str>] impl
immediately above. Routes byte-for-byte through the
substrate-primitive CaixaVersion::as_str pub const fn
accessor (via str::to_owned wrapped in
std::borrow::Cow::Owned) so every consumer that holds a
borrowed [&CaixaVersion] and needs a [Cow<'static, str>] —
a […].iter().map(Cow::<'static, str>::from).collect::<Vec<_>>()
per-instance materializer over &[CaixaVersion] (whose iterator
yields &CaixaVersion, not CaixaVersion, so the paired
owned-input [From<CaixaVersion> for Cow<'static, str>] axis
alone forces every call site through an explicit .clone() /
dereference restatement), a future
HashMap::<Cow<'static, str>, _>::from_iter that keys off a
borrowed-iteration axis where cloning the wrapper would allocate
one String beyond the eventual [Cow::Owned] arm’s own, a
future generic
<T: for<'a> Into<Cow<'static, str>>>-bound emitter on a
per-caixa diagnostic column that walks the
iter().map(Into::into) shape verbatim — reaches the wrapped
byte-string through this one dispatch on the substrate primitive.
Deliberately returns std::borrow::Cow::Owned rather than
std::borrow::Cow::Borrowed — the substrate-primitive
CaixaVersion::as_str accessor’s return does not carry the
&'static str lifetime by construction, so the
[Cow<'static, str>] output shape rules out the borrowed arm and
the owned arm is the type-correct projection (mirroring the paired
owned-input impl’s own [Cow::Owned] discipline). Second corner
on the {Self, &Self} → Cow<'static, str> reverse-projection
family opened on the paired owned-input 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 [Cow<'static, str>] axis but not the borrowed-input axis
forces every borrowed call site through a .clone() /
<Cow<'static, str>>::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_cow_str_routes_through_as_str_accessor]
(byte-parity + [Cow::Owned]-arm pin against
CaixaVersion::as_str via a borrowed input, plus a
source-survival witness against silent move-out) and
[tests::caixa_version_from_owned_and_borrowed_into_cow_str_agree_on_every_shape]
(cross-axis partition pin against the paired owned-input impl on
the same instance, closing the “owned-input move vs. borrowed-input
clone” bifurcation on the same wrapped body through the
[Cow<'static, str>] axis).
Source§impl From<&CaixaVersion> for Box<str>
Trait-idiomatic borrowed-input, Box<str> output reverse
projection on the CaixaVersion newtype primitive — the
borrowed-input companion to the paired owned-input
[From<CaixaVersion> for Box<str>] impl immediately above. Routes
byte-for-byte through the substrate-primitive
CaixaVersion::as_str pub const fn accessor (via
Box::<str>::from(&str), which allocates a fit-to-length boxed
slice from the borrowed &str in one heap allocation without an
intermediary String) so every consumer that holds a borrowed
[&CaixaVersion] and needs a Box<str> — a
[…].iter().map(Box::<str>::from).collect::<Vec<_>>() per-instance
materializer over &[CaixaVersion] (whose iterator yields
&CaixaVersion, not CaixaVersion, so the paired owned-input
[From<CaixaVersion> for Box<str>] axis alone forces every call
site through an explicit .clone() / dereference restatement), a
future HashMap::<Box<str>, _>::from_iter that keys off a
borrowed-iteration axis, a future generic
<T: for<'a> Into<Box<str>>>-bound emitter on a per-caixa
diagnostic column that walks the iter().map(Into::into) shape
verbatim — reaches the wrapped byte-string through this one dispatch
on the substrate primitive.
impl From<&CaixaVersion> for Box<str>
Trait-idiomatic borrowed-input, Box<str> output reverse
projection on the CaixaVersion newtype primitive — the
borrowed-input companion to the paired owned-input
[From<CaixaVersion> for Box<str>] impl immediately above. Routes
byte-for-byte through the substrate-primitive
CaixaVersion::as_str pub const fn accessor (via
Box::<str>::from(&str), which allocates a fit-to-length boxed
slice from the borrowed &str in one heap allocation without an
intermediary String) so every consumer that holds a borrowed
[&CaixaVersion] and needs a Box<str> — a
[…].iter().map(Box::<str>::from).collect::<Vec<_>>() per-instance
materializer over &[CaixaVersion] (whose iterator yields
&CaixaVersion, not CaixaVersion, so the paired owned-input
[From<CaixaVersion> for Box<str>] axis alone forces every call
site through an explicit .clone() / dereference restatement), a
future HashMap::<Box<str>, _>::from_iter that keys off a
borrowed-iteration axis, a future generic
<T: for<'a> Into<Box<str>>>-bound emitter on a per-caixa
diagnostic column that walks the iter().map(Into::into) shape
verbatim — reaches the wrapped byte-string through this one dispatch
on the substrate primitive.
Second corner on the {Self, &Self} → Box<str> reverse-projection
family opened on the paired owned-input 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 Box<str> axis but not the borrowed-input axis forces
every borrowed call site through a .clone() /
<Box<str>>::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_box_str_routes_through_as_str_accessor]
(byte-parity pin against CaixaVersion::as_str via a borrowed
input, plus a source-survival witness against silent move-out) and
[tests::caixa_version_from_owned_and_borrowed_into_box_str_agree_on_every_shape]
(cross-corner partition pin between owned-input move and
borrowed-input clone on the same wrapped body through the
Box<str> axis).
Source§impl From<&CaixaVersion> for Arc<str>
Trait-idiomatic borrowed-input, std::sync::Arc<str> output
reverse projection on the CaixaVersion newtype primitive — the
borrowed-input companion to the paired owned-input
[From<CaixaVersion> for std::sync::Arc<str>] impl immediately
above. Routes byte-for-byte through the substrate-primitive
CaixaVersion::as_str pub const fn accessor (via
std::sync::Arc::<str>::from(&str), which allocates a fresh
atomically-refcounted heap slab from the borrowed &str in one
heap allocation without an intermediary String or Box<str>)
so every consumer that holds a borrowed [&CaixaVersion] and needs
a std::sync::Arc<str> — a
[…].iter().map(std::sync::Arc::<str>::from).collect::<Vec<_>>()
per-instance materializer over &[CaixaVersion] (whose iterator
yields &CaixaVersion, not CaixaVersion, so the paired
owned-input [From<CaixaVersion> for std::sync::Arc<str>] axis
alone forces every call site through an explicit .clone() /
dereference restatement), a future
HashMap::<std::sync::Arc<str>, _>::from_iter that keys off a
borrowed-iteration axis, a future generic
<T: for<'a> Into<std::sync::Arc<str>>>-bound emitter on a
per-caixa diagnostic column that walks the
iter().map(Into::into) shape verbatim — reaches the wrapped
byte-string through this one dispatch on the substrate primitive.
impl From<&CaixaVersion> for Arc<str>
Trait-idiomatic borrowed-input, std::sync::Arc<str> output
reverse projection on the CaixaVersion newtype primitive — the
borrowed-input companion to the paired owned-input
[From<CaixaVersion> for std::sync::Arc<str>] impl immediately
above. Routes byte-for-byte through the substrate-primitive
CaixaVersion::as_str pub const fn accessor (via
std::sync::Arc::<str>::from(&str), which allocates a fresh
atomically-refcounted heap slab from the borrowed &str in one
heap allocation without an intermediary String or Box<str>)
so every consumer that holds a borrowed [&CaixaVersion] and needs
a std::sync::Arc<str> — a
[…].iter().map(std::sync::Arc::<str>::from).collect::<Vec<_>>()
per-instance materializer over &[CaixaVersion] (whose iterator
yields &CaixaVersion, not CaixaVersion, so the paired
owned-input [From<CaixaVersion> for std::sync::Arc<str>] axis
alone forces every call site through an explicit .clone() /
dereference restatement), a future
HashMap::<std::sync::Arc<str>, _>::from_iter that keys off a
borrowed-iteration axis, a future generic
<T: for<'a> Into<std::sync::Arc<str>>>-bound emitter on a
per-caixa diagnostic column that walks the
iter().map(Into::into) shape verbatim — reaches the wrapped
byte-string through this one dispatch on the substrate primitive.
Second corner on the {Self, &Self} → std::sync::Arc<str>
reverse-projection family opened on the paired owned-input 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 std::sync::Arc<str> axis but not the borrowed-input
axis forces every borrowed call site through a .clone() /
<std::sync::Arc<str>>::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_arc_str_routes_through_as_str_accessor]
(byte-parity pin against CaixaVersion::as_str via a borrowed
input, plus a source-survival witness against silent move-out) and
[tests::caixa_version_from_owned_and_borrowed_into_arc_str_agree_on_every_shape]
(cross-corner partition pin between owned-input move and
borrowed-input clone on the same wrapped body through the
std::sync::Arc<str> axis).
Source§impl From<&CaixaVersion> for Rc<str>
Trait-idiomatic borrowed-input, std::rc::Rc<str> output reverse
projection on the CaixaVersion newtype primitive — the borrowed-
input companion to the paired owned-input
[From<CaixaVersion> for std::rc::Rc<str>] impl immediately above.
Routes byte-for-byte through the substrate-primitive
CaixaVersion::as_str pub const fn accessor (via
std::rc::Rc::<str>::from(&str), which allocates a fresh
single-threaded-refcounted heap slab from the borrowed &str in one
heap allocation without an intermediary String or Box<str>) so
every consumer that holds a borrowed [&CaixaVersion] and needs a
std::rc::Rc<str> — a
[…].iter().map(std::rc::Rc::<str>::from).collect::<Vec<_>>()
per-instance materializer over &[CaixaVersion] (whose iterator yields
&CaixaVersion, not CaixaVersion, so the paired owned-input
[From<CaixaVersion> for std::rc::Rc<str>] axis alone forces every
call site through an explicit .clone() / dereference restatement), a
future single-threaded HashMap::<std::rc::Rc<str>, _>::from_iter that
keys off a borrowed-iteration axis, a future generic
<T: for<'a> Into<std::rc::Rc<str>>>-bound emitter on a per-caixa
diagnostic column that walks the iter().map(Into::into) shape
verbatim — reaches the wrapped byte-string through this one dispatch on
the substrate primitive.
impl From<&CaixaVersion> for Rc<str>
Trait-idiomatic borrowed-input, std::rc::Rc<str> output reverse
projection on the CaixaVersion newtype primitive — the borrowed-
input companion to the paired owned-input
[From<CaixaVersion> for std::rc::Rc<str>] impl immediately above.
Routes byte-for-byte through the substrate-primitive
CaixaVersion::as_str pub const fn accessor (via
std::rc::Rc::<str>::from(&str), which allocates a fresh
single-threaded-refcounted heap slab from the borrowed &str in one
heap allocation without an intermediary String or Box<str>) so
every consumer that holds a borrowed [&CaixaVersion] and needs a
std::rc::Rc<str> — a
[…].iter().map(std::rc::Rc::<str>::from).collect::<Vec<_>>()
per-instance materializer over &[CaixaVersion] (whose iterator yields
&CaixaVersion, not CaixaVersion, so the paired owned-input
[From<CaixaVersion> for std::rc::Rc<str>] axis alone forces every
call site through an explicit .clone() / dereference restatement), a
future single-threaded HashMap::<std::rc::Rc<str>, _>::from_iter that
keys off a borrowed-iteration axis, a future generic
<T: for<'a> Into<std::rc::Rc<str>>>-bound emitter on a per-caixa
diagnostic column that walks the iter().map(Into::into) shape
verbatim — reaches the wrapped byte-string through this one dispatch on
the substrate primitive.
Second corner on the {Self, &Self} → std::rc::Rc<str> reverse-
projection family opened on the paired owned-input 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 std::rc::Rc<str> axis but not the
borrowed-input axis forces every borrowed call site through a
.clone() / <std::rc::Rc<str>>::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_rc_str_routes_through_as_str_accessor]
(byte-parity pin against CaixaVersion::as_str via a borrowed input,
plus a source-survival witness against silent move-out) and
[tests::caixa_version_from_owned_and_borrowed_into_rc_str_agree_on_every_shape]
(cross-corner partition pin between owned-input move and borrowed-
input clone on the same wrapped body through the std::rc::Rc<str>
axis).
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<CaixaVersion> for Cow<'static, str>
Trait-idiomatic owned-input, std::borrow::Cow<'static, str>
output reverse projection on the CaixaVersion newtype
primitive — the [Cow<'static, str>] companion to the paired
owned-input [From<CaixaVersion> for String] impl (999a310) on
the same primitive. Routes through
std::borrow::Cow::Owned(v.0), moving the wrapper’s own heap
allocation through verbatim (no re-copy of the per-instance version
body’s bytes, no allocating detour through
CaixaVersion::as_str + str::to_owned) — so every consumer
that binds a CaixaVersion through the standard-library .into()
/ [From<Self> for Cow<'static, str>] axis reaches the wrapped
byte-string through one substrate-primitive dispatch on the exact
same heap allocation the manifest-parse forward
[From<String> for CaixaVersion] constructor accepted.
impl From<CaixaVersion> for Cow<'static, str>
Trait-idiomatic owned-input, std::borrow::Cow<'static, str>
output reverse projection on the CaixaVersion newtype
primitive — the [Cow<'static, str>] companion to the paired
owned-input [From<CaixaVersion> for String] impl (999a310) on
the same primitive. Routes through
std::borrow::Cow::Owned(v.0), moving the wrapper’s own heap
allocation through verbatim (no re-copy of the per-instance version
body’s bytes, no allocating detour through
CaixaVersion::as_str + str::to_owned) — so every consumer
that binds a CaixaVersion through the standard-library .into()
/ [From<Self> for Cow<'static, str>] axis reaches the wrapped
byte-string through one substrate-primitive dispatch on the exact
same heap allocation the manifest-parse forward
[From<String> for CaixaVersion] constructor accepted.
A future consumer that wants a [Cow<'static, str>]-typed handle
on a CaixaVersion — a
metric_label: Cow<'static, str> = versao.into() structured-log
key on a future per-caixa caixa-operator reconciliation counter
(whose emit surface types metric keys as Cow<'static, str> so
static compile-time literals and dynamic version bodies share the
same key-slot without an unconditional heap allocation on the
literal path), a future
HashMap::<Cow<'static, str>, _>::from_iter([(versao.into(), _)])
per-versao lookup where the map’s key type is
[Cow<'static, str>] rather than owned String so
literal-lifetime keys can share the same map without wrapping in an
extra String allocation, a future M4 admission-webhook
rejection body whose per-arm error message composes through
format!("{}", Cow::<'static, str>::from(caixa.versao)) where the
[Cow<'static, str>] intermediate is what the sibling error-frame
composer accepts — reaches the wrapped byte-string through this
one dispatch, without the pre-lift .to_string().into() /
Cow::Owned(String::from(v)) double-hop that would allocate a
fresh intermediary String on the way to the same
[Cow::Owned] arm.
Deliberately returns std::borrow::Cow::Owned rather than
std::borrow::Cow::Borrowed — the substrate-primitive
CaixaVersion::as_str accessor’s return does not carry the
&'static str lifetime by construction (the wrapped String
storage is a runtime heap allocation, not a compile-time literal),
so the [Cow<'static, str>] output shape rules out the borrowed
arm and the owned arm is the type-correct projection. Peer of the
paired owned-input [From<CaixaVersion> for String] impl on the
same primitive — both route through the wrapper’s own heap
allocation via a move on v.0, preserving the zero-copy
discipline the substrate opens on its String-wrapper newtype
primitive.
Opens the trait-idiomatic owned-input, [Cow<'static, str>]
reverse-projection axis on the substrate’s core String-wrapper
newtype primitive CaixaVersion, mirroring the paired
[Cow<'static, str>] forward-projection family the sibling
closed-set fieldless typed enums (via
crate::supervisor::RestartStrategy,
crate::supervisor::RestartPolicy, and the remaining twelve
closed-set enums) already carry — on the enum peers, the paired
axis returns [Cow::Borrowed] because the accessor returns
&'static str; on this newtype the paired axis returns
[Cow::Owned] because the wrapped storage is runtime-allocated.
Rust’s standard library does not derive From<Self> for Cow<'static, str> from From<Self> for String (nor derive
From<&Self> from From<Self>), so every newtype that carries a
reverse From<Self> for String unwrap axis but not the paired
[Cow<'static, str>] axis forces every
[Cow<'static, str>]-typed call site through a .to_string().into()
double-allocation detour that heap-allocates a fresh intermediary
String between the wrapper and the [Cow::Owned] arm.
Pinned load-bearing by
[tests::caixa_version_from_into_owned_cow_str_returns_owned_wrapped_body]
(byte-parity + [Cow::Owned]-arm pin against
CaixaVersion::as_str on the same instance, plus a round-trip
witness through the paired [From<String> for CaixaVersion]
constructor) and
[tests::caixa_version_from_into_owned_cow_str_and_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 into String vs. owned-input into
[Cow<'static, str>]” bifurcation on the same wrapped body).
Source§impl From<CaixaVersion> for Box<str>
Trait-idiomatic owned-input, Box<str> output reverse projection
on the CaixaVersion newtype primitive — the Box<str> companion
to the paired owned-input [From<CaixaVersion> for String] (999a310)
and [From<CaixaVersion> for std::borrow::Cow<'static, str>] (55532e5)
impls on the same primitive. Routes through
String::into_boxed_str(v.0), shrinking the wrapper’s own heap
allocation to a fit-to-length boxed slice — no re-copy of the
per-instance version body’s bytes on the fixed-capacity path
(String::into_boxed_str reuses the underlying Vec<u8> buffer
verbatim when the length matches its capacity; when the String
carries slack it reallocates once to shrink), so every consumer that
binds a CaixaVersion through the standard-library .into() /
[From<Self> for Box<str>] axis reaches the wrapped byte-string
through one substrate-primitive dispatch on the same underlying heap
storage the manifest-parse forward [From<String> for CaixaVersion]
constructor accepted.
impl From<CaixaVersion> for Box<str>
Trait-idiomatic owned-input, Box<str> output reverse projection
on the CaixaVersion newtype primitive — the Box<str> companion
to the paired owned-input [From<CaixaVersion> for String] (999a310)
and [From<CaixaVersion> for std::borrow::Cow<'static, str>] (55532e5)
impls on the same primitive. Routes through
String::into_boxed_str(v.0), shrinking the wrapper’s own heap
allocation to a fit-to-length boxed slice — no re-copy of the
per-instance version body’s bytes on the fixed-capacity path
(String::into_boxed_str reuses the underlying Vec<u8> buffer
verbatim when the length matches its capacity; when the String
carries slack it reallocates once to shrink), so every consumer that
binds a CaixaVersion through the standard-library .into() /
[From<Self> for Box<str>] axis reaches the wrapped byte-string
through one substrate-primitive dispatch on the same underlying heap
storage the manifest-parse forward [From<String> for CaixaVersion]
constructor accepted.
A future consumer that wants a Box<str>-typed handle on a
CaixaVersion — a per-caixa struct field typed Box<str> rather
than String to trim the sixteen-byte length + capacity header
down to eight bytes on the pointer + length pair (a shape the
substrate acknowledges as the natural fixed-length storage for
once-written-never-mutated version strings held across the whole
operator reconciliation cycle), a future
HashMap::<Box<str>, _>::from_iter([(versao.into(), _)]) per-versao
lookup where the map’s key type is Box<str> rather than owned
String so the map’s per-entry key-slot carries the sixteen-byte
Box<str> header instead of the twenty-four-byte String
header, a future M4 admission-webhook rejection body whose per-arm
error-frame composer accepts a Box<str> intermediate for the
same reason — reaches the wrapped byte-string through this one
dispatch, without the pre-lift .to_string().into_boxed_str()
double-hop that would allocate a fresh intermediary String on
the way to the same Box<str> slot.
Peer of the paired owned-input [From<CaixaVersion> for String]
(999a310) and [From<CaixaVersion> for Cow<'static, str>] (55532e5)
impls on the same primitive — all three route through v.0
(the String axis returns the wrapped buffer verbatim; the
[Cow<'static, str>] axis wraps it in [Cow::Owned]; this axis
shrinks it to a fit-to-length boxed slice via String::into_boxed_str),
preserving the zero-copy discipline the substrate opens on its
String-wrapper newtype primitive across the three reverse-projection
axes. Rust’s standard library does not derive From<Self> for Box<str> from From<Self> for String (nor from From<Self> for Cow<'static, str>), so every newtype that carries the paired
reverse From<Self> for String axis but not the paired
Box<str> axis forces every Box<str>-typed call site through
a .to_string().into_boxed_str() double-allocation detour that
heap-allocates a fresh intermediary String between the wrapper
and the Box<str> slot.
Opens the trait-idiomatic owned-input, Box<str>
reverse-projection axis on the substrate’s core String-wrapper
newtype primitive CaixaVersion, extending the reverse-projection
matrix from the two axes already opened on this primitive (999a310
on the String axis, 55532e5 on the [Cow<'static, str>] axis)
onto the third. The fourth and final axis on the matrix
(std::sync::Arc<str>) is closed by the sibling paired
[From<CaixaVersion> for std::sync::Arc<str>] +
[From<&CaixaVersion> for std::sync::Arc<str>] impls immediately below.
Pinned load-bearing by
[tests::caixa_version_from_into_owned_box_str_returns_wrapped_body]
(byte-parity pin against CaixaVersion::as_str on the same
instance, plus a round-trip witness through the paired
[From<String> for CaixaVersion] constructor closing the two-way
Self → Box<str> → Self cycle by construction) and
[tests::caixa_version_from_into_owned_box_str_and_string_agree_on_every_shape]
(cross-axis partition pin against the paired owned-input
[From<CaixaVersion> for String] and
[From<CaixaVersion> for Cow<'static, str>] impls on the same
instance, closing the “owned-input into String vs. owned-input
into [Cow<'static, str>] vs. owned-input into Box<str>”
three-corner bifurcation on the same wrapped body).
Source§impl From<CaixaVersion> for Arc<str>
Trait-idiomatic owned-input, std::sync::Arc<str> output reverse
projection on the CaixaVersion newtype primitive — the
std::sync::Arc<str> companion to the paired owned-input
[From<CaixaVersion> for String] (999a310),
[From<CaixaVersion> for std::borrow::Cow<'static, str>] (55532e5),
and [From<CaixaVersion> for Box<str>] (32d861a) impls on the same
primitive. Routes through std::sync::Arc::<str>::from(v.0),
which allocates a fresh atomically-refcounted heap slab whose data
slot byte-equals the wrapper’s own String storage — the wrapped
bytes move through by value into the Arc<str> layout in one heap
allocation (the std::sync::Arc<str> layout carries a strong
count + weak count header ahead of the byte slice, so a copy is
required regardless of the input axis; no intermediary String
or Box<str> is materialized on the owned-input path).
impl From<CaixaVersion> for Arc<str>
Trait-idiomatic owned-input, std::sync::Arc<str> output reverse
projection on the CaixaVersion newtype primitive — the
std::sync::Arc<str> companion to the paired owned-input
[From<CaixaVersion> for String] (999a310),
[From<CaixaVersion> for std::borrow::Cow<'static, str>] (55532e5),
and [From<CaixaVersion> for Box<str>] (32d861a) impls on the same
primitive. Routes through std::sync::Arc::<str>::from(v.0),
which allocates a fresh atomically-refcounted heap slab whose data
slot byte-equals the wrapper’s own String storage — the wrapped
bytes move through by value into the Arc<str> layout in one heap
allocation (the std::sync::Arc<str> layout carries a strong
count + weak count header ahead of the byte slice, so a copy is
required regardless of the input axis; no intermediary String
or Box<str> is materialized on the owned-input path).
A future consumer that wants a std::sync::Arc<str>-typed handle
on a CaixaVersion — a share-through-clone version body held
across a per-caixa caixa-operator reconcile task where every
spawn point wants a cheap .clone() on the version handle without
each task re-allocating its own String copy (the
std::sync::Arc::clone path bumps the atomic refcount in place
and returns a pointer-width handle), a future
HashMap::<std::sync::Arc<str>, _>::from_iter per-versao lookup
where the map’s key type is std::sync::Arc<str> so the same
version-body pointer can key both the map and the payload without a
second heap allocation, a future M4 admission-webhook decoder that
materializes decoded version strings as std::sync::Arc<str>
slices so downstream verdict-composer tasks running on separate
worker threads can share the immutable body without a
per-consumer String::clone — reaches the wrapped byte-string
through this one dispatch, without the pre-lift
.to_string().into::<std::sync::Arc<str>>() double-hop that would
still allocate the same [Arc<str>] slab plus one intermediary
String between the wrapper and the std::sync::Arc<str> slot.
Peer of the paired owned-input [From<CaixaVersion> for String]
(999a310), [From<CaixaVersion> for Cow<'static, str>] (55532e5),
and [From<CaixaVersion> for Box<str>] (32d861a) impls on the same
primitive — all four route through v.0 (the String axis
returns the wrapped buffer verbatim; the [Cow<'static, str>] axis
wraps it in [Cow::Owned]; the Box<str> axis shrinks it to a
fit-to-length boxed slice; this axis copies the bytes into a fresh
atomically-refcounted slab whose header carries the atomic strong +
weak counters the std::sync::Arc<str> layout requires),
preserving the substrate’s single-dispatch reverse-projection
discipline across the four axes. Rust’s standard library does not
derive From<Self> for Arc<str> from From<Self> for String (nor
from From<Self> for Box<str> or From<Self> for Cow<'static, str>),
so every newtype that carries the paired reverse From<Self> for String / Box<str> / Cow<'static, str> axes but not the paired
std::sync::Arc<str> axis forces every
std::sync::Arc<str>-typed call site through a
.to_string().into() / Arc::<str>::from(v.to_string())
double-allocation detour that heap-allocates a fresh intermediary
String between the wrapper and the std::sync::Arc<str> slot.
Closes the trait-idiomatic owned-input, std::sync::Arc<str>
reverse-projection axis on the substrate’s core String-wrapper
newtype primitive CaixaVersion, completing the reverse-projection
matrix on this primitive across the full {String, Cow<'static, str>, Box<str>, Arc<str>} roster — the fourth and final axis (999a310 on
the String axis, 55532e5 on the [Cow<'static, str>] axis,
32d861a on the Box<str> axis, this axis on the
std::sync::Arc<str> axis).
Pinned load-bearing by
[tests::caixa_version_from_into_owned_arc_str_returns_wrapped_body]
(byte-parity pin against CaixaVersion::as_str on the same
instance, plus a round-trip witness through the paired
[From<String> for CaixaVersion] constructor closing the two-way
Self → Arc<str> → Self cycle by construction) and
[tests::caixa_version_from_into_owned_arc_str_and_string_agree_on_every_shape]
(cross-axis partition pin against the paired owned-input
[From<CaixaVersion> for String], [From<CaixaVersion> for Cow<'static, str>],
and [From<CaixaVersion> for Box<str>] impls on the same instance,
closing the four-corner “owned-input into String vs. Cow<'static, str>
vs. Box<str> vs. Arc<str>” partition on the same wrapped body).
Source§impl From<CaixaVersion> for Rc<str>
Trait-idiomatic owned-input, std::rc::Rc<str> output reverse
projection on the CaixaVersion newtype primitive — the owned-heap-
string, single-threaded-reference-counted inverse of the pre-existing
[From<String> for CaixaVersion] / [From<&str> for CaixaVersion]
forward-projection pair on this primitive. Consumes the owned wrapper
by value, moves the wrapped String into the std::rc::Rc<str>
layout in one heap allocation (the std::rc::Rc<str> layout carries
a strong count + weak count header ahead of the byte slice, so the copy
is required regardless of the input axis; no intermediary String or
Box<str> is materialized on the owned-input path) — the exact
single-threaded mirror of the paired
[From<CaixaVersion> for std::sync::Arc<str>] impl (3e67756) on the
atomically-refcounted axis.
impl From<CaixaVersion> for Rc<str>
Trait-idiomatic owned-input, std::rc::Rc<str> output reverse
projection on the CaixaVersion newtype primitive — the owned-heap-
string, single-threaded-reference-counted inverse of the pre-existing
[From<String> for CaixaVersion] / [From<&str> for CaixaVersion]
forward-projection pair on this primitive. Consumes the owned wrapper
by value, moves the wrapped String into the std::rc::Rc<str>
layout in one heap allocation (the std::rc::Rc<str> layout carries
a strong count + weak count header ahead of the byte slice, so the copy
is required regardless of the input axis; no intermediary String or
Box<str> is materialized on the owned-input path) — the exact
single-threaded mirror of the paired
[From<CaixaVersion> for std::sync::Arc<str>] impl (3e67756) on the
atomically-refcounted axis.
A future consumer that wants a std::rc::Rc<str>-typed handle on a
CaixaVersion — a per-feira verb’s single-threaded diagnostic
composer that clones the version body across a chain of Nord-themed
column emitters without paying either the String::clone
full-allocation cost (every step re-allocates its own buffer) or the
atomic-refcount overhead the paired std::sync::Arc<str> axis
forces (the std::rc::Rc::clone path bumps a non-atomic refcount in
place and returns a pointer-width handle, cheaper than the paired
atomic increment on the sibling std::sync::Arc<str> axis by a
measurable margin on hot single-threaded call sites), a future single-
threaded HashMap::<std::rc::Rc<str>, _>::from_iter per-versao lookup
where the map’s key type is std::rc::Rc<str> so the same version-
body pointer can key both the map and the payload without a second heap
allocation, a future feira lint per-caixa diagnostic table whose
per-column Cell<std::rc::Rc<str>> payload carries the version body
across the row-composer + column-composer + wrapper phases through the
pointer-width handle rather than a String per phase — reaches the
wrapped byte-string through this one dispatch, without the pre-lift
.to_string().into::<std::rc::Rc<str>>() double-hop that would still
allocate the same [Rc<str>] slab plus one intermediary String
between the wrapper and the std::rc::Rc<str> slot.
Peer of the paired owned-input [From<CaixaVersion> for String]
(999a310), [From<CaixaVersion> for Cow<'static, str>] (55532e5),
[From<CaixaVersion> for Box<str>] (32d861a), and
[From<CaixaVersion> for std::sync::Arc<str>] (3e67756) impls on the
same primitive — all five route through v.0 (the String axis
returns the wrapped buffer verbatim; the [Cow<'static, str>] axis
wraps it in [Cow::Owned]; the Box<str> axis shrinks it to a
fit-to-length boxed slice; the [Arc<str>] axis copies the bytes into
a fresh atomically-refcounted slab; this axis copies the bytes into a
fresh single-threaded-refcounted slab whose header carries the non-
atomic strong + weak counters the std::rc::Rc<str> layout
requires), preserving the substrate’s single-dispatch reverse-
projection discipline across the five axes. Rust’s standard library
does not derive From<Self> for Rc<str> from From<Self> for Arc<str>
(the std::sync::Arc<str> and std::rc::Rc<str> layouts share the
same on-disk shape but the trait tables are disjoint, and no blanket
impl<T> From<T> for Rc<str> where Arc<str>: From<T> exists in
core), so every newtype that carries the paired
std::sync::Arc<str> axis but not the paired std::rc::Rc<str>
axis forces every single-threaded std::rc::Rc<str>-typed call site
through a .to_string().into() / Rc::<str>::from(v.to_string())
double-allocation detour that heap-allocates a fresh intermediary
String between the wrapper and the std::rc::Rc<str> slot.
Extends the trait-idiomatic owned-input reverse-projection matrix on
the substrate’s core String-wrapper newtype primitive CaixaVersion
onto the single-threaded reference-counted axis — the fifth axis
(999a310 on String, 55532e5 on [Cow<'static, str>], 32d861a on
Box<str>, 3e67756 on std::sync::Arc<str>, this axis on
std::rc::Rc<str>).
Pinned load-bearing by
[tests::caixa_version_from_into_owned_rc_str_returns_wrapped_body]
(byte-parity pin against CaixaVersion::as_str on the same instance,
plus a round-trip witness through the paired [From<String> for CaixaVersion] constructor closing the two-way Self → Rc<str> → Self
cycle by construction) and
[tests::caixa_version_from_into_owned_rc_str_and_arc_str_agree_on_every_shape]
(cross-axis partition pin against the paired owned-input
[From<CaixaVersion> for String],
[From<CaixaVersion> for Cow<'static, str>],
[From<CaixaVersion> for Box<str>], and
[From<CaixaVersion> for std::sync::Arc<str>] impls on the same
instance, closing the five-corner “owned-input into String vs.
Cow<'static, str> vs. Box<str> vs. Arc<str> vs. Rc<str>”
partition on the same wrapped body).
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.