UDisks2

Struct UDisks2 

Source
pub struct UDisks2 { /* private fields */ }

Implementations§

Source§

impl UDisks2

Source

pub fn new() -> Result<Self, Error>

Source

pub fn update(&mut self) -> Result<(), Error>

Refresh the managed objects fetched from the DBus server.

Source

pub fn get_drive(&self, path: &str) -> Option<Drive>

Find the drive that corresponds to the given dbus object path.

Source

pub fn get_drives<'a>(&'a self) -> impl Iterator<Item = Drive> + 'a

An iterator of Drive objects fetched from the inner cached managed objects.

Source

pub fn get_block(&self, path: &str) -> Option<Block>

Find the block that corresponds to the given dbus object path.

Source

pub fn get_blocks<'a>(&'a self) -> impl Iterator<Item = Block> + 'a

An iterator of Block objects fetched from the inner cached managed objects.

Source

pub fn smart_update<'a>( &'a self, drive: impl Into<Path<'a>>, allow_wakeup: bool, ) -> Result<(), Error>

Update the S.M.A.R.T. attributes of a drive. You may pass either a &Drive or &str which is a path to a drive, starting with /org/freedesktop/UDisks2/drives/.

Source

pub fn smart_attributes<'a>( &'a self, drive: impl Into<Path<'a>>, allow_wakeup: bool, ) -> Result<SmartValue, Error>

Get the S.M.A.R.T. attributes of a drive. You may pass either a &Drive or &str which is a path to a drive, starting with /org/freedesktop/UDisks2/drives/.

Auto Trait Implementations§

§

impl !Freeze for UDisks2

§

impl !RefUnwindSafe for UDisks2

§

impl Send for UDisks2

§

impl !Sync for UDisks2

§

impl Unpin for UDisks2

§

impl !UnwindSafe for UDisks2

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.