pub struct RuntimeRef { /* private fields */ }Expand description
A runtime the node resolves by name, as opposed to runtime = "self"
which resolves inside the bundle.
Wire form is slash-separated, either <name>/<version> (stock, e.g.
mesofact/0.8.20) or <namespace>/<name>/<version> (a custom runtime
published under an org/project, e.g. acme/site/1.2.3). The namespace is
what keeps two orgs’ site runtimes from colliding in one node cache.
This parses the general form even though BundleRuntime::parse accepts
only mesofact/<ver> today: the node cache layout is the thing that is
expensive to change later (bytes on disk across a fleet), the manifest field
is not. Accepting a namespaced ref here early is forward-compatible and
unreachable in practice until a manifest can express one — R746-F6 versioned
the contract such an expression would range over, but left the field itself
a single runtime name (W272 §7).
Implementations§
Source§impl RuntimeRef
impl RuntimeRef
Sourcepub fn parse(s: &str) -> Result<Self, BundleError>
pub fn parse(s: &str) -> Result<Self, BundleError>
Parse the wire form (<name>/<ver> or <ns>/<name>/<ver>).
Every segment is validated to [A-Za-z0-9._+-]+ and rejected if it is
. or ... That is not decoration: these segments are joined onto a
node’s cache directory, so a permissive parse would let a published
manifest name a write target outside the cache. Same reasoning as
store::checked_rel for bundle content paths.
Sourcepub fn cache_rel_bin(&self, triple: &str, bin: &str) -> PathBuf
pub fn cache_rel_bin(&self, triple: &str, bin: &str) -> PathBuf
Cache-relative path to the binary named bin:
runtimes/[<ns>/]<name>/<ver>/<triple>/<bin>.
bin is a bare filename, never a path — it comes from a published
manifest, and joining an unchecked one onto the cache dir would be the
same write-outside-the-cache primitive RuntimeRef::parse exists to
deny. Callers pass a compile-time constant (SERVE_BIN,
kamaji’s FEED_BIN_NAME); check_bin_name enforces it for the
manifest-supplied side.
Sourcepub fn cache_rel_dir(&self, triple: &str) -> PathBuf
pub fn cache_rel_dir(&self, triple: &str) -> PathBuf
Cache-relative directory holding this runtime’s binaries for triple:
runtimes/[<ns>/]<name>/<ver>/<triple>.
Sourcepub fn cache_rel_serve(&self, triple: &str) -> PathBuf
pub fn cache_rel_serve(&self, triple: &str) -> PathBuf
Cache-relative path to the serve binary:
runtimes/[<ns>/]<name>/<ver>/<triple>/serve. The SERVE_BIN case of
cache_rel_bin.
Sourcepub fn asset_manifest_prefix(&self) -> String
pub fn asset_manifest_prefix(&self) -> String
Object-store key prefix every published asset manifest for this
runtime sits directly under: runtimes/[<ns>/]<name>/<ver>/.
The trailing slash is load-bearing — without it mesofact/0.8.2 would
list mesofact/0.8.20’s assets too. Entries below it are
<triple>.toml and nothing else, so a listed key with a further / in
it belongs to some other ref and is not this runtime’s.
Sourcepub fn asset_manifest_key(&self, triple: &str) -> String
pub fn asset_manifest_key(&self, triple: &str) -> String
Object-store key of the published asset manifest for triple:
runtimes/[<ns>/]<name>/<ver>/<triple>.toml.
By name, not by content — this is the one mutable-shaped key in the scheme, and it is what turns “mesofact/0.8.20 on x86_64 musl” into a blake3 the node can then verify bytes against.
Trait Implementations§
Source§impl Clone for RuntimeRef
impl Clone for RuntimeRef
Source§impl Debug for RuntimeRef
impl Debug for RuntimeRef
Source§impl Display for RuntimeRef
impl Display for RuntimeRef
impl Eq for RuntimeRef
Source§impl Hash for RuntimeRef
impl Hash for RuntimeRef
Source§impl Ord for RuntimeRef
impl Ord for RuntimeRef
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 RuntimeRef
impl PartialEq for RuntimeRef
Source§impl PartialOrd for RuntimeRef
impl PartialOrd for RuntimeRef
impl StructuralPartialEq for RuntimeRef
Auto Trait Implementations§
impl Freeze for RuntimeRef
impl RefUnwindSafe for RuntimeRef
impl Send for RuntimeRef
impl Sync for RuntimeRef
impl Unpin for RuntimeRef
impl UnsafeUnpin for RuntimeRef
impl UnwindSafe for RuntimeRef
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.