Trait CmdlineContent

Source
pub trait CmdlineContent {
    // Required methods
    fn parse(buffer: &str) -> Result<Cmdline, (usize, &'static str)>;
    fn render(&self) -> Result<String, &'static str>;
    fn add_param(&mut self, key: String, value: Option<String>);
}
Expand description

Basic Cmdline content operations

Required Methods§

Source

fn parse(buffer: &str) -> Result<Cmdline, (usize, &'static str)>

Parses a UTF8 &str and returns a Cmdline object

§Arguments
  • buffer: &str: the cmdline string
§Returns

A Cmdline object that represents the contents of the input string

§Errors

Returns a (usize, &’static str) error pointing at the line position of the error as well as an error message

Source

fn render(&self) -> Result<String, &'static str>

Renders a Cmdline object into a valid cmdline string

§Returns

A String that represents the Cmdline object

§Errors

Returns error if a parameter has bogus values

Source

fn add_param(&mut self, key: String, value: Option<String>)

Adds a parameter to a Cmdline

§Arguments
  • key: String: The parameter name
  • value: Option<String>: An optional value

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.

Implementors§