use dbus as dbus;
#[allow(unused_imports)]
use dbus::arg;
use dbus::blocking;
pub trait OrgChromiumSpaced {
fn get_free_disk_space(&self, path: &str) -> Result<i64, dbus::Error>;
fn get_total_disk_space(&self, path: &str) -> Result<i64, dbus::Error>;
fn get_root_device_size(&self) -> Result<i64, dbus::Error>;
fn is_quota_supported(&self, path: &str) -> Result<bool, dbus::Error>;
fn get_quota_current_space_for_uid(&self, path: &str, uid: u32) -> Result<i64, dbus::Error>;
fn get_quota_current_space_for_gid(&self, path: &str, gid: u32) -> Result<i64, dbus::Error>;
fn get_quota_current_space_for_project_id(&self, path: &str, project_id: u32) -> Result<i64, dbus::Error>;
fn get_quota_current_spaces_for_ids(&self, request: Vec<u8>) -> Result<Vec<u8>, dbus::Error>;
fn get_quota_overall_usage(&self, path: &str) -> Result<Vec<u8>, dbus::Error>;
fn get_quota_overall_usage_pretty_print(&self, path: &str) -> Result<String, dbus::Error>;
fn set_project_id(&self, fd: arg::OwnedFd, project_id: u32) -> Result<Vec<u8>, dbus::Error>;
fn set_project_inheritance_flag(&self, fd: arg::OwnedFd, enable: bool) -> Result<Vec<u8>, dbus::Error>;
}
#[derive(Debug)]
pub struct OrgChromiumSpacedStatefulDiskSpaceUpdate {
pub status: Vec<u8>,
}
impl arg::AppendAll for OrgChromiumSpacedStatefulDiskSpaceUpdate {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.status, i);
}
}
impl arg::ReadAll for OrgChromiumSpacedStatefulDiskSpaceUpdate {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(OrgChromiumSpacedStatefulDiskSpaceUpdate {
status: i.read()?,
})
}
}
impl dbus::message::SignalArgs for OrgChromiumSpacedStatefulDiskSpaceUpdate {
const NAME: &'static str = "StatefulDiskSpaceUpdate";
const INTERFACE: &'static str = "org.chromium.Spaced";
}
impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> OrgChromiumSpaced for blocking::Proxy<'a, C> {
fn get_free_disk_space(&self, path: &str) -> Result<i64, dbus::Error> {
self.method_call("org.chromium.Spaced", "GetFreeDiskSpace", (path, ))
.and_then(|r: (i64, )| Ok(r.0, ))
}
fn get_total_disk_space(&self, path: &str) -> Result<i64, dbus::Error> {
self.method_call("org.chromium.Spaced", "GetTotalDiskSpace", (path, ))
.and_then(|r: (i64, )| Ok(r.0, ))
}
fn get_root_device_size(&self) -> Result<i64, dbus::Error> {
self.method_call("org.chromium.Spaced", "GetRootDeviceSize", ())
.and_then(|r: (i64, )| Ok(r.0, ))
}
fn is_quota_supported(&self, path: &str) -> Result<bool, dbus::Error> {
self.method_call("org.chromium.Spaced", "IsQuotaSupported", (path, ))
.and_then(|r: (bool, )| Ok(r.0, ))
}
fn get_quota_current_space_for_uid(&self, path: &str, uid: u32) -> Result<i64, dbus::Error> {
self.method_call("org.chromium.Spaced", "GetQuotaCurrentSpaceForUid", (path, uid, ))
.and_then(|r: (i64, )| Ok(r.0, ))
}
fn get_quota_current_space_for_gid(&self, path: &str, gid: u32) -> Result<i64, dbus::Error> {
self.method_call("org.chromium.Spaced", "GetQuotaCurrentSpaceForGid", (path, gid, ))
.and_then(|r: (i64, )| Ok(r.0, ))
}
fn get_quota_current_space_for_project_id(&self, path: &str, project_id: u32) -> Result<i64, dbus::Error> {
self.method_call("org.chromium.Spaced", "GetQuotaCurrentSpaceForProjectId", (path, project_id, ))
.and_then(|r: (i64, )| Ok(r.0, ))
}
fn get_quota_current_spaces_for_ids(&self, request: Vec<u8>) -> Result<Vec<u8>, dbus::Error> {
self.method_call("org.chromium.Spaced", "GetQuotaCurrentSpacesForIds", (request, ))
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))
}
fn get_quota_overall_usage(&self, path: &str) -> Result<Vec<u8>, dbus::Error> {
self.method_call("org.chromium.Spaced", "GetQuotaOverallUsage", (path, ))
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))
}
fn get_quota_overall_usage_pretty_print(&self, path: &str) -> Result<String, dbus::Error> {
self.method_call("org.chromium.Spaced", "GetQuotaOverallUsagePrettyPrint", (path, ))
.and_then(|r: (String, )| Ok(r.0, ))
}
fn set_project_id(&self, fd: arg::OwnedFd, project_id: u32) -> Result<Vec<u8>, dbus::Error> {
self.method_call("org.chromium.Spaced", "SetProjectId", (fd, project_id, ))
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))
}
fn set_project_inheritance_flag(&self, fd: arg::OwnedFd, enable: bool) -> Result<Vec<u8>, dbus::Error> {
self.method_call("org.chromium.Spaced", "SetProjectInheritanceFlag", (fd, enable, ))
.and_then(|r: (Vec<u8>, )| Ok(r.0, ))
}
}