Struct sota::rvi::services::Services [] [src]

pub struct Services {
    pub remote: Arc<Mutex<RemoteServices>>,
    pub sender: Arc<Mutex<Sender<Event>>>,
    pub transfers: Arc<Mutex<Transfers>>,
}

Hold references to RVI service endpoints, currently active Transfers, and where to broadcast outcome Events to.

Fields

remote
sender
transfers

Methods

impl Services
[src]

fn new(rvi_cfg: RviConfig, device_id: String, sender: Sender<Event>) -> Self

Set up a new RVI service handler, pruning any inactive Transfers each second.

fn register_services<F: Fn(&str) -> String>(&mut self, register: F)

Register each RVI endpoint with the provided registration function which should return a String representation of the URL used to contact that service.

fn handle_service(&self, service: &str, id: u64, msg: &str) -> Result<RpcOk<i32>, RpcErr>

Handle an incoming message for a specific service endpoint.

Trait Implementations

Derived Implementations

impl Clone for Services
[src]

fn clone(&self) -> Services

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more