pub struct Cmdline { /* private fields */ }Expand description
A builder for a kernel command line string that validates the string as its being built. A
CString can be constructed from this directly using CString::new.
Implementations§
Source§impl Cmdline
impl Cmdline
Sourcepub fn new(capacity: usize) -> Cmdline
pub fn new(capacity: usize) -> Cmdline
Constructs an empty Cmdline with the given capacity, which includes the nul terminator. Capacity must be greater than 0.
Sourcepub fn insert<T: AsRef<str>>(&mut self, key: T, val: T) -> Result<()>
pub fn insert<T: AsRef<str>>(&mut self, key: T, val: T) -> Result<()>
Validates and inserts a key value pair into this command line.
Sourcepub fn insert_str<T: AsRef<str>>(&mut self, slug: T) -> Result<()>
pub fn insert_str<T: AsRef<str>>(&mut self, slug: T) -> Result<()>
Validates and inserts a string to the end of the current command line.
Sourcepub fn as_cstring(&self) -> Result<CString>
pub fn as_cstring(&self) -> Result<CString>
Returns the cmdline in progress as CString.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cmdline
impl RefUnwindSafe for Cmdline
impl Send for Cmdline
impl Sync for Cmdline
impl Unpin for Cmdline
impl UnsafeUnpin for Cmdline
impl UnwindSafe for Cmdline
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more