pub struct CallAddress { /* private fields */ }Expand description
ONE-6: the literal address of one call — the activation it is
dispatched to and the method, named apart. The gate is told it by
whoever dispatches (plexus-core), from the path it routes, never from a
parameter; a service’s Resolve is never asked about an address.
A method of X, or a child of X. A dotted path alone does not say
which of its dots separates the activation from the method, so the
gate is told: the activation is one or more segments, the method is
exactly one. dyn.connect is the method connect of the activation
dyn; dyn.peer.shop.items.list is the method list of the activation
dyn.peer.shop.items — mounted under dyn, not of it. Since a method
may not hold a dot, a path has one way to be told and no other: a
caller that split it anywhere but at its last dot is refused here.
What an address scope covers (ScopeRef::covers_address):
| held on | covers the call at A.m when |
|---|---|
*, self | always |
/P | P is A (a method of that activation) or P is A.m (that one method) |
/P.* | A.m is P or begins with P. (P and all beneath it) |
So operator on /dyn reaches dyn.connect and not
dyn.peer.shop.items.list; operator on /dyn.* reaches both;
operator on /dyn.peer.shop.* reaches the peer shop alone.
/P names a method and an activation alike. /dyn.connect covers
the method dyn.connect and every method of an activation mounted at
dyn.connect, should one exist. An address cannot tell them apart; a
service that mounts a child under a method’s name gives both to whoever
holds /P.
The contract a dispatcher relies on. What is refused here: an empty
segment, a method holding a dot, and any byte outside A–Z a–z 0–9 _ -
(so *, @, {, /, a space, non-ASCII). What cannot be refused
here: a key that holds a dot, joined into the activation’s path
(dyn.peer.github.repos.alice.app.v2.issues) — it reads as two
segments, and /…alice.app.* would cover the repository app.v2. A
dispatcher builds the address from its routed segments with
CallAddress::of_segments, which refuses a segment holding a dot,
and never joins or splits a key itself. An address that cannot be built
is no address: the call is decided as told none, where an address scope
holds nothing — never on a shorter address that would parse.
Implementations§
Source§impl CallAddress
impl CallAddress
Sourcepub fn new(activation: &str, method: &str) -> Result<Self, AddressError>
pub fn new(activation: &str, method: &str) -> Result<Self, AddressError>
The call of method on the activation at activation
(CallAddress::new("dyn.peer.shop.items", "list")). Refused unless
activation is dotted segments and method is one segment, each of
A–Z a–z 0–9 _ -.
Sourcepub fn of_segments(
activation: &[&str],
method: &str,
) -> Result<Self, AddressError>
pub fn of_segments( activation: &[&str], method: &str, ) -> Result<Self, AddressError>
The call of method on the activation whose path is activation,
segment by segment as routed (["dyn", "peer", "shop", "items"],
"list"). Each is one segment: one holding a dot (a key app.v2)
is refused, never split.
Sourcepub fn activation(&self) -> &str
pub fn activation(&self) -> &str
The activation’s address: dyn, dyn.peer.shop.items.