Skip to main content

CallAddress

Struct CallAddress 

Source
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 oncovers the call at A.m when
*, selfalways
/PP 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

Source

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 _ -.

Source

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.

Source

pub fn activation(&self) -> &str

The activation’s address: dyn, dyn.peer.shop.items.

Source

pub fn method(&self) -> &str

The method’s name: connect.

Source

pub fn path(&self) -> &str

The whole address, as dispatched: dyn.connect.

Trait Implementations§

Source§

impl Clone for CallAddress

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CallAddress

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CallAddress

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CallAddress

Source§

impl Hash for CallAddress

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for CallAddress

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CallAddress

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more