[−][src]Struct devicemapper::DmOptions
Encapsulates options for device mapper calls
Methods
impl DmOptions
[src]
pub fn new() -> DmOptions
[src]
Create a new empty option
pub fn set_flags(&mut self, flags: DmFlags) -> &mut DmOptions
[src]
Set the DmFlags value for option. Note this call is not additive in that it sets (replaces) entire flag value in one call. Thus if you want to incrementally add additional flags you need to retrieve current and '|' with new.
use devicemapper::DmFlags; use devicemapper::DmOptions; let mut options = DmOptions::new(); options.set_flags(DmFlags::DM_READONLY); let flags = DmFlags::DM_PERSISTENT_DEV | options.flags(); options.set_flags(flags);
pub fn set_cookie(&mut self, cookie: DmCookie) -> &mut DmOptions
[src]
Set the cookie bitfield value for option (overloaded meaning with event_nr in header). Note this call is not additive in that it sets (replaces) entire cookie value in one call. Thus if you want to incrementally add additional flags you need to retrieve current and '|' with new.
use devicemapper::{DmCookie, DmFlags}; use devicemapper::DmOptions; let mut options = DmOptions::new(); options.set_cookie(DmCookie::DM_UDEV_PRIMARY_SOURCE_FLAG); let new_cookie = options.cookie() | DmCookie::DM_UDEV_DISABLE_DM_RULES_FLAG; options.set_cookie(new_cookie);
pub fn flags(&self) -> DmFlags
[src]
Retrieve the flags value
pub fn cookie(&self) -> DmCookie
[src]
Retrieve the cookie value (used for input in upper 16 bits of event_nr header field).
Trait Implementations
impl Clone for DmOptions
[src]
fn clone(&self) -> DmOptions
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for DmOptions
[src]
impl Debug for DmOptions
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,