pub fn insert_str<T: AsRef<str>>(&mut self, slug: T) -> Result<()> {
        let s = slug.as_ref();
        valid_str(s)?;

        self.has_capacity(s.len())?;

        self.start_push();
        self.line.push_str(s);
        self.end_push();

        Ok(())
    }
/// Validates and inserts a string to the end of the current command line.
///
/// # Arguments
///
/// * `slug` - String to be appended to the command line.
///
/// # Examples
///
/// ```rust
/// # use linux_loader::cmdline::*;
/// # use std::ffi::CString;
/// let mut cl = Cmdline::new(100);
/// cl.insert_str("foobar");
/// let cl_cstring = CString::new(cl).unwrap();
/// assert_eq!(cl_cstring.to_str().unwrap(), "foobar");
/// ```
Validates and inserts a string to the end of the current command line.
Validates and inserts a string to the end of the current command line .
pub fn insert_str<T: AsRef<str>>(&mut self, slug: T) -> Result<()> {
        let s = slug.as_ref();
        valid_str(s)?;
        self.has_capacity(s.len())?;
        self.start_push();
        self.line.push_str(s);
        self.end_push();
        Ok(())
    }
pub fn insert_str < T : AsRef < str > > ( & mut self , slug : T ) -> Result < ( ) > { let s = slug . as_ref ( ) ; valid_str ( s ) ? ; self . has_capacity ( s . len ( ) ) ? ; self . start_push ( ) ; self . line . push_str ( s ) ; self . end_push ( ) ; Ok ( ( ) ) }
Validates and inserts a string to the end of the current command line.
Validates and inserts a string to the end of the current command line .
&mut self
slug
T
&mut self
slug
T
examples
None
use linux_loader::cmdline::*;
None
use std::ffi::cstring;
let mut cl = Cmdline::new(100);
cl.insert_str("foobar");
let cl_cstring = CString::new(cl).unwrap();
assert_eq!(cl_cstring.to_str().unwrap(), "foobar");
```
let mut cl = Cmdline :: new ( 100 ) ; cl . insert_str ( " foobar " ) ; let cl_cstring = CString :: new ( cl ) . unwrap () ; assert_eq! ( cl_cstring . to_str () . unwrap () " foobar " ) ; ` ` `