[][src]Enum controlgroup::Max

pub enum Max {
    Max,
    Limit(u32),
}

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

Max

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]

type Err = Error

The associated error which can be returned from parsing.

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]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]