[][src]Struct cjdns_admin::Connection

pub struct Connection {
    pub functions: Funcs,
    // some fields omitted
}

Admin connection to the CJDNS node.

Cloneable: cloned connection uses same underlying UDP socket and is thread-safe.

Fields

functions: Funcs

List of available remote functions.

Implementations

impl Connection[src]

pub async fn invoke<A: Args, P: Payload, '_, '_>(
    &'_ mut self,
    remote_fn_name: &'_ str,
    args: A
) -> Result<P, Error>
[src]

Call remote function on CJDNS router.

Example:

let res: GenericResponsePayload = conn.invoke("MyFunc", ArgValues::new().add("arg1", 42).add("arg2", "foobar")).await?;

or use macro cjdns_invoke to make it even more concise:

let res = cjdns_invoke!(conn, "FuncName", "arg1" = 42, "arg2" = "foobar").await?;

Trait Implementations

impl Clone for Connection[src]

Auto Trait Implementations

impl !RefUnwindSafe for Connection

impl Send for Connection

impl Sync for Connection

impl Unpin for Connection

impl !UnwindSafe for Connection

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,