pub struct CommandName { /* private fields */ }Expand description
A validated command name.
Implementations§
Source§impl CommandName
impl CommandName
Sourcepub fn new(name: impl Into<String>) -> Result<Self, CommandNameError>
pub fn new(name: impl Into<String>) -> Result<Self, CommandNameError>
Creates a validated command name.
§Errors
Returns CommandNameError when name is empty, contains path separators, or contains
control characters.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Returns the owned command name.
Trait Implementations§
Source§impl AsRef<str> for CommandName
impl AsRef<str> for CommandName
Source§impl Clone for CommandName
impl Clone for CommandName
Source§fn clone(&self) -> CommandName
fn clone(&self) -> CommandName
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandName
impl Debug for CommandName
Source§impl Display for CommandName
impl Display for CommandName
Source§impl Hash for CommandName
impl Hash for CommandName
Source§impl PartialEq for CommandName
impl PartialEq for CommandName
Source§fn eq(&self, other: &CommandName) -> bool
fn eq(&self, other: &CommandName) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for CommandName
impl StructuralPartialEq for CommandName
Auto Trait Implementations§
impl Freeze for CommandName
impl RefUnwindSafe for CommandName
impl Send for CommandName
impl Sync for CommandName
impl Unpin for CommandName
impl UnsafeUnpin for CommandName
impl UnwindSafe for CommandName
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