use zbus::proxy;
use crate::error;
#[proxy(
interface = "org.freedesktop.UDisks2.Manager",
default_service = "org.freedesktop.UDisks2",
default_path = "/org/freedesktop/UDisks2/Manager"
)]
pub trait Manager {
fn can_check(&self, type_: &str) -> error::Result<(bool, String)>;
fn can_format(&self, type_: &str) -> error::Result<(bool, String)>;
fn can_repair(&self, type_: &str) -> error::Result<(bool, String)>;
fn can_resize(&self, type_: &str) -> error::Result<(bool, u64, String)>;
fn enable_module(&self, name: &str, enable: bool) -> error::Result<()>;
#[deprecated(note = "Use EnableModule instead")]
fn enable_modules(&self, enable: bool) -> error::Result<()>;
fn get_block_devices(
&self,
options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
) -> error::Result<Vec<zbus::zvariant::OwnedObjectPath>>;
fn loop_setup(
&self,
fd: zbus::zvariant::Fd<'_>,
options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
) -> error::Result<zbus::zvariant::OwnedObjectPath>;
#[zbus(name = "MDRaidCreate")]
fn mdraid_create(
&self,
blocks: &[zbus::zvariant::ObjectPath<'_>],
level: &str,
name: &str,
chunk: u64,
options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
) -> error::Result<zbus::zvariant::OwnedObjectPath>;
fn resolve_device(
&self,
devspec: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
options: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
) -> error::Result<Vec<zbus::zvariant::OwnedObjectPath>>;
#[zbus(property)]
fn default_encryption_type(&self) -> error::Result<String>;
#[zbus(property)]
fn supported_encryption_types(&self) -> error::Result<Vec<String>>;
#[zbus(property)]
fn supported_filesystems(&self) -> error::Result<Vec<String>>;
#[zbus(property)]
fn version(&self) -> error::Result<String>;
}