pub trait MeshResolver {
// Required method
fn resolve(
&self,
ident: &MeshIdent,
kind: MeshLookup,
) -> Result<String, MeshError>;
}Expand description
Resolve crate::EnvValue::FromMesh references to literal env values.
Defined in workload-spec so clients (agents, desktop, CLI) can render
specs against fake mesh state without depending on the yubaba crate.
Yubaba’s production implementation (in yubaba::deploy::mesh_resolve)
reads from raft state.
Resolution rules (R844-B22 replaced the positional ones):
MeshLookup::Host— the bare DNS-ish identifier as authored (e.g."noisetable-db.pdx"). Needs no port and resolves for a portless peer.MeshLookup::Url—"http://<ident>:<port>".MeshLookup::Port— that port stringified, e.g."5432".MeshLookup::UrlNamed/MeshLookup::PortNamed— the same, at the peer’s port of that name.
Which port is select_mesh_port’s decision, and implementations must
route through it rather than re-deriving: a sole port, else the one named
DEFAULT_PORT_NAME, else an error. It is emphatically not “the first
entry”, which is what this trait’s doc used to promise — declaration order
is not a statement about which listener a dependent should dial, and acting
as if it were is how a workload gets handed a metrics port as its API URL.
Because the rule is name-based rather than positional, a Url and a Port
resolved in the same deploy agree by construction; the old doc had to ask
implementations to make the lookup atomic to get that.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".