Struct varlink::VarlinkService [−][src]
pub struct VarlinkService { /* fields omitted */ }
VarlinkService handles all the I/O and dispatches method calls to the registered interfaces.
Methods
impl VarlinkService
[src]
impl VarlinkService
pub fn new<S: Into<Cow<'static, str>>>(
vendor: S,
product: S,
version: S,
url: S,
interfaces: Vec<Box<Interface + Send + Sync>>
) -> Self
[src]
pub fn new<S: Into<Cow<'static, str>>>(
vendor: S,
product: S,
version: S,
url: S,
interfaces: Vec<Box<Interface + Send + Sync>>
) -> Self
Create a new VarlinkService
.
See the Service section of the
varlink wiki about the vendor
, product
, version
and url
.
The interfaces
vector is an array of varlink Interfaces
this service provides.
Examples
let service = varlink::VarlinkService::new( "org.varlink", "test service", "0.1", "http://varlink.org", vec![ Box::new(interface_foo), Box::new(interface_bar), Box::new(interface_baz), ], );
pub fn handle(&self, bufreader: &mut BufRead, writer: &mut Write) -> Result<()>
[src]
pub fn handle(&self, bufreader: &mut BufRead, writer: &mut Write) -> Result<()>
Handles incoming varlink messages from reader
and sends the reply on writer
.
This method can be used to implement your own server.
Trait Implementations
impl Interface for VarlinkService
[src]
impl Interface for VarlinkService
Auto Trait Implementations
impl Send for VarlinkService
impl Send for VarlinkService
impl Sync for VarlinkService
impl Sync for VarlinkService