Struct systemd-dbus::Connection [-]  [+] [src]

pub struct Connection<'a> {
    // some fields omitted
}

Main type representing a connection to systemd via Dbus.

use system-dbus::Connection;

let conn=Connection::new();
println!("{:?}", conn.list_units());

Methods

impl<'a> Connection<'a>

fn new() -> Result<Connection<'a>, SystemdError>

Create a new connection to systemd

fn add_match(&self, rule_string: &str) -> Result<(), SystemdError>

Add a match rule for signals

fn systemd_signals(&self) -> Result<(), SystemdError>

Start subscription to systemd signals

impl<'a> Connection<'a>

fn get_unit(&self, name: &str) -> Result<ObjectPath, SystemdError>

impl<'a> Connection<'a>

fn get_unit_by_pid(&self, pid: u32) -> Result<Vec<Job>, SystemdError>

impl<'a> Connection<'a>

fn load_unit(&self, name: String) -> Result<ObjectPath, SystemdError>

impl<'a> Connection<'a>

fn start_unit(&self, name: String, mode: String) -> Result<ObjectPath, SystemdError>

impl<'a> Connection<'a>

fn start_unit_replace(&self, old_unit: String, new_unit: String, mode: String) -> Result<ObjectPath, SystemdError>

impl<'a> Connection<'a>

fn stop_unit(&self, name: String, mode: String) -> Result<ObjectPath, SystemdError>

impl<'a> Connection<'a>

fn reload_unit(&self, name: String, mode: String) -> Result<ObjectPath, SystemdError>

impl<'a> Connection<'a>

fn restart_unit(&self, name: String, mode: String) -> Result<ObjectPath, SystemdError>

impl<'a> Connection<'a>

fn try_restart_unit(&self, name: String, mode: String) -> Result<ObjectPath, SystemdError>

impl<'a> Connection<'a>

fn reload_or_restart_unit(&self, name: String, mode: String) -> Result<ObjectPath, SystemdError>

impl<'a> Connection<'a>

fn reload_or_try_restart_unit(&self, name: String, mode: String) -> Result<ObjectPath, SystemdError>

impl<'a> Connection<'a>

fn kill_unit(&self, name: String, who: String, signal: u32) -> Result<ObjectPath, SystemdError>

impl<'a> Connection<'a>

fn reset_failed_unit(&self, name: String) -> Result<ObjectPath, SystemdError>

impl<'a> Connection<'a>

fn get_job(&self, id: u32) -> Result<ObjectPath, SystemdError>

impl<'a> Connection<'a>

fn cancel_job(&self, id: u32) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn clear_jobs(&self) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn reset_failed(&self) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn list_units(&self) -> Result<Vec<UnitStatus>, SystemdError>

impl<'a> Connection<'a>

fn list_jobs(&self) -> Result<Vec<Job>, SystemdError>

impl<'a> Connection<'a>

fn subscribe(&self) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn unsubscribe(&self) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn create_snapshot(&self, name: String, cleanup: bool) -> Result<ObjectPath, SystemdError>

impl<'a> Connection<'a>

fn remove_snapshot(&self, name: String) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn reload(&self) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn reexecute(&self) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn reboot(&self) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn power_off(&self) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn halt(&self) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn k_exec(&self) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn switch_root(&self, new_root: String, init: String) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn set_environment(&self, names: String) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn unset_environment(&self, names: String) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn unset_and_set_environment(&self, unset: String, set: String) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn list_unit_files(&self) -> Result<Vec<UnitFile>, SystemdError>

impl<'a> Connection<'a>

fn get_unit_file_state(&self, file: String) -> Result<String, SystemdError>

impl<'a> Connection<'a>

fn enable_unit_files(&self, files: String, runtime: bool, force: bool) -> Result<UnitFileChanges, SystemdError>

impl<'a> Connection<'a>

fn disable_unit_files(&self, files: String, runtime: bool) -> Result<Vec<UnitFileChange>, SystemdError>

impl<'a> Connection<'a>

fn reenable_unit_files(&self, files: String, runtime: bool, force: bool) -> Result<UnitFileChanges, SystemdError>

impl<'a> Connection<'a>

impl<'a> Connection<'a>

fn preset_unit_files(&self, files: String, runtime: bool, force: bool) -> Result<UnitFileChanges, SystemdError>

impl<'a> Connection<'a>

fn mask_unit_files(&self, files: String, runtime: bool, force: bool) -> Result<Vec<UnitFileChange>, SystemdError>

impl<'a> Connection<'a>

fn unmask_unit_files(&self, files: String, runtime: bool) -> Result<Vec<UnitFileChange>, SystemdError>

impl<'a> Connection<'a>

fn set_default_target(&self, files: String) -> Result<Vec<UnitFileChange>, SystemdError>

impl<'a> Connection<'a>

fn get_default_target(&self) -> Result<String, SystemdError>

impl<'a> Connection<'a>

fn set_unit_properties(&self, name: String, runtime: bool, properties: Vec<UnitProperty>) -> Result<(), SystemdError>

impl<'a> Connection<'a>

fn set_transient_unit(&self, name: String, mode: String, properties: Vec<UnitProperty>, aux: Vec<UnitAux>) -> Result<ObjectPath, SystemdError>

Trait Implementations

Derived Implementations

impl<'a> Debug for Connection<'a>

fn fmt(&self, __arg_0: &mut Formatter) -> Result