Skip to main content

Route

Struct Route 

Source
pub struct Route { /* private fields */ }
Expand description

A generated client’s route: its path, and a refusal if an instance name on the way to it cannot be routed.

Implementations§

Source§

impl Route

Source

pub const ROOT: Route

The activation at its own namespace.

Source

pub fn at(path: impl Into<RoutePath>, namespace: &str) -> Route

The activation mounted at path (its namespace, or empty, is Route::ROOT).

Source

pub fn path<'a>(&'a self, namespace: &'a str) -> &'a str

The dotted path: namespace when mounted at its own.

Source

pub fn child(&self, segment: &str, joined: &'static str) -> Route

The route of the static child segment. joined is "{namespace}.{segment}", known when the program is written: a child of a client at its own namespace costs no allocation.

Source

pub fn instance(&self, namespace: &str, name: &str, statics: &[&str]) -> Route

The route of the dynamic instance name, refused when the service would not reach the instance with it: empty, dotted, outside its path grammar (is_route_segment), or one of the parent’s static children’s statics. A name that is a method of the parent is fine: the service takes it as the child.

Source

pub fn segment(&self, name: &str) -> Route

NEST-14: the route of the segment name below this one — a peer slot’s name, an untyped child — joined to this route’s path as it is (empty: name alone), refused as Route::instance refuses a name, with no static children to avoid.

Source

pub fn refusal(&self) -> Option<ClientError>

NEST-14: why nothing may be sent along this route, if anything — the error every call through it is.

Source

pub fn method(&self, method: MethodRef) -> Result<MethodRef, ClientError>

method sent along this route, or why it may not be.

Trait Implementations§

Source§

impl Clone for Route

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 Route

Source§

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

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

impl Eq for Route

Source§

impl PartialEq for Route

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 Route

Auto Trait Implementations§

§

impl Forget for Route

§

impl Freeze for Route

§

impl RefUnwindSafe for Route

§

impl Send for Route

§

impl Sync for Route

§

impl Unpin for Route

§

impl UnsafeUnpin for Route

§

impl UnwindSafe for Route

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSendSync for T
where T: Send + Sync,

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