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]
pub fn new(
vendor: &str,
product: &str,
version: &str,
url: &str,
interfaces: Vec<Box<Interface + Send + Sync>>
) -> Self
[src]
vendor: &str,
product: &str,
version: &str,
url: &str,
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, reader: &mut Read, writer: &mut Write) -> Result<()>
[src]
Handles incoming varlink messages from reader
and sends the reply on writer
.
This method can be used to implement your own server.