Trait ShortFlags

Source
pub trait ShortFlags: Flags + Copy {
    const SHORT_FLAGS: &'static [char];

    // Provided methods
    fn from_char(c: char) -> Option<Self> { ... }
    fn from_str(s: &str) -> Self { ... }
    fn apply_modification(&mut self, modification: &str) { ... }
    fn summary(&self) -> String { ... }
}
Expand description

Trait for Flags to provide short flag functionality.

Required Associated Constants§

Source

const SHORT_FLAGS: &'static [char]

The set of defined short flags. Must be of the same length as Flags::FLAGS.

Provided Methods§

Source

fn from_char(c: char) -> Option<Self>

Parses a character into a Flags.

Source

fn from_str(s: &str) -> Self

Parses a string into self, with given short flags.

Source

fn apply_modification(&mut self, modification: &str)

Applies the given modification string.

Source

fn summary(&self) -> String

Returns a concise summary of the flags, with short flag for set flags and - for unset flags.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ShortFlags for Permissions

Source§

const SHORT_FLAGS: &'static [char]

Implementors§