Skip to main content

Untyped

Struct Untyped 

Source
pub struct Untyped<T> { /* private fields */ }
Expand description

An untyped client: a transport and the dotted path of a node.

Implementations§

Source§

impl<T> Untyped<T>

Source

pub fn new(transport: T, path: impl Into<RoutePath>) -> Self

The node at the dotted path ("host.dendrite.digest"); empty is the service itself.

Source

pub fn from_route(transport: T, route: Route) -> Self

The node at route — what a generated accessor builds; a refused route makes a client every call of which fails at once.

Source

pub fn path(&self) -> &str

The node’s dotted path.

Source

pub fn route(&self) -> &Route

The node’s route.

Source

pub fn transport(&self) -> &T

Borrow the transport.

Source

pub fn into_transport(self) -> T

Unwrap the transport.

Source

pub fn child(&self, name: &str) -> Untyped<&T>

The node name below this one (<path>.<name>): a static child, an instance of a dynamic one, a peer slot’s name. A name that is not a route segment makes a client every call of which fails at once with ClientError::InvalidName.

Source

pub fn into_child(self, name: &str) -> Untyped<T>

Self::child, keeping the transport.

Source

pub fn typed_unchecked<C: FromRoute<T>>(self) -> C

The generated client C of this node, unchecked — for a caller that knows the interface by other means, or a build with no ShapeCheck (a client-only one).

Source§

impl<T: Transport> Untyped<T>

Source

pub fn call(&self, method: &str, params: Value) -> MethodStream<'_, Value>

Call method on this node with params (an object, by name): its items as JSON, Err for the call failing, progress dropped (.with_progress() keeps it).

Source

pub async fn call_one( &self, method: &str, params: Value, ) -> Result<Value, ClientError>

Call a one-item method: its item, or why there is none.

Source

pub async fn schema(&self) -> Result<Value, ClientError>

The node’s schema, as it answers <path>.schema.

Source

pub async fn typed<C: FromRoute<T> + ShapeCheck>(self) -> Result<C, ClientError>

This node as the generated client C, once its schema says it serves C’s interface: every method C calls under the same shape (a node that serves more is fine). Else ClientError::ShapeMismatch, and nothing else is called.

Trait Implementations§

Source§

impl<T: Clone> Clone for Untyped<T>

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<T: Debug> Debug for Untyped<T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Forget for Untyped<T>

§

impl<T> Freeze for Untyped<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Untyped<T>
where T: RefUnwindSafe,

§

impl<T> Send for Untyped<T>
where T: Send,

§

impl<T> Sync for Untyped<T>
where T: Sync,

§

impl<T> Unpin for Untyped<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Untyped<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for Untyped<T>
where T: UnwindSafe,

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.