Struct qrpc_sdk::Service[][src]

pub struct Service {
    pub name: String,
    pub version: u16,
    pub description: String,
    // some fields omitted
}

A service representation on the qrpc system

Use this struct to handle RPC connections to the network, and to update any data you want your service to broadcast to other participants on the QRPC system.

Fields

name: Stringversion: u16description: String

Implementations

impl Service[src]

pub fn new<S: Into<String>>(name: S, version: u16, description: S) -> Self[src]

Create a new service without hash_id

The hash_id field will be filled in by the remote RPC server after calling register().

pub async fn register(&mut self, socket: Arc<RpcSocket>) -> RpcResult<Identity>[src]

Register this service with the RPC broker/ libqaul

pub fn hash_id(&self) -> Option<Identity>[src]

Get the hash_id field of this service, if it’s set

pub fn get_socket(&self) -> Arc<RpcSocket>[src]

Get the RpcSocket for this service

This function is called by other component SDKs to get access to the underlying RPC socket.

Auto Trait Implementations

impl !RefUnwindSafe for Service

impl Send for Service

impl Sync for Service

impl Unpin for Service

impl !UnwindSafe for Service

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> Instrument for T[src]

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

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