Trait unicom::Backend

source ·
pub trait Backend {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn connector(&self, url: &Url) -> Option<BoxedConnector>;
}
Expand description

Backend interface

Required Methods§

source

fn name(&self) -> &str

The name of backend

Examples: tcp, serial.

source

fn description(&self) -> &str

The backend description

source

fn connector(&self, url: &Url) -> Option<BoxedConnector>

Create connector

This method should check URL and extract connection options from it.

Method returns connector instance when URL is compatible with backend.

Implementors§

source§

impl<T> Backend for T
where T: Deref<Target = dyn Backend>,