[−][src]Enum controlgroup::Max
Limits the maximum number or amount of a resource, or not limits.
Max
implements FromStr
and Display
. You can convert a string into a Max
and vice
versa. parse
returns an error with kind ErrorKind::Parse
if failed.
use controlgroup::Max; let max = "max".parse::<Max>().unwrap(); assert_eq!(max, Max::Max); let num = "42".parse::<Max>().unwrap(); assert_eq!(num, Max::Limit(42)); assert_eq!(Max::Max.to_string(), "max"); assert_eq!(Max::Limit(42).to_string(), "42");
Max
also implements Default
, which yields Max::Max
.
use controlgroup::Max; assert_eq!(Max::default(), Max::Max);
Variants
Not limit the maximum number or amount of a resource.
Limit(u32)
Limits the maximum number or amount of a resource to this value.
Trait Implementations
impl Eq for Max
[src]
impl Default for Max
[src]
impl Clone for Max
[src]
impl PartialEq<Max> for Max
[src]
impl From<u32> for Max
[src]
impl Copy for Max
[src]
impl Debug for Max
[src]
impl Display for Max
[src]
impl FromStr for Max
[src]
Auto Trait Implementations
impl Send for Max
impl Unpin for Max
impl Sync for Max
impl UnwindSafe for Max
impl RefUnwindSafe for Max
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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,