pub struct rLIPC { /* private fields */ }

Implementations

Returns a new LIPC client if a connection was successful Connects to the LIPC bus with no name.

Register a callback for events broadcasted by service. Optionally, you can filter to a single event by providing name.

For callback, we pass (source, name, optional int param, optional str param). an example callback payload would be “com.lab126.appmgrd”, “appActivating”, Some(1), Some(“com.lab126.booklet.reader”)

Examples
use libopenlipc_sys::rLIPC;
let r = rLIPC::new().unwrap();
r.subscribe("com.lab126.powerd", Some("battLevelChanged"), |_, _, _, _| ());
// You will only get updates about battLevel in the callback
// battLevelChanged sends <int param> with the new battery value
use libopenlipc_sys::rLIPC;
let r = rLIPC::new().unwrap();
r.subscribe("com.lab126.powerd", None, |_, _, _, _| ());
// You will get updates all power related events (screen on, off, etc)

Get the current value of a string property

use libopenlipc_sys::rLIPC;
let r = rLIPC::new().unwrap();
let reader_status = r.get_str_prop("com.lab126.acxreaderplugin", "allReaderData").unwrap();
// reader_status would be a string containing JSON

Get the current value of an int property

use libopenlipc_sys::rLIPC;
let r = rLIPC::new().unwrap();
let reader_status = r.get_int_prop("com.lab126.powerd", "battLevel").unwrap();
// reader_status will contain the battery charge % (ie: 75).

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.