[−][src]Struct mpd_protocol::command::Command
A single command, possibly including arguments.
Implementations
impl Command
[src]
pub fn new(command: impl Into<Cow<'static, str>>) -> Self
[src]
Start a new command.
Same as Command::build
, but panics on error instead of returning a result.
pub fn build(
command: impl Into<Cow<'static, str>>
) -> Result<Self, CommandError>
[src]
command: impl Into<Cow<'static, str>>
) -> Result<Self, CommandError>
Start a new command.
Errors
Errors are returned when the command base is invalid (e.g. empty string or containing whitespace).
pub fn argument(self, argument: impl Argument) -> Self
[src]
Add an argument to the command.
Same as Command::add_argument
, but returns Self
and panics on error.
pub fn add_argument(
&mut self,
argument: impl Argument
) -> Result<(), CommandError>
[src]
&mut self,
argument: impl Argument
) -> Result<(), CommandError>
Add an argument to the command.
Errors
Errors are returned when the argument is invalid (e.g. empty string or containing invalid characters such as newlines).
Trait Implementations
impl Clone for Command
[src]
impl Debug for Command
[src]
impl Encoder<Command> for MpdCodec
[src]
type Error = MpdCodecError
The type of encoding errors. Read more
fn encode(
&mut self,
command: Command,
dst: &mut BytesMut
) -> Result<(), Self::Error>
[src]
&mut self,
command: Command,
dst: &mut BytesMut
) -> Result<(), Self::Error>
impl Eq for Command
[src]
impl Extend<Command> for CommandList
[src]
fn extend<T: IntoIterator<Item = Command>>(&mut self, iter: T)
[src]
fn extend_one(&mut self, item: A)
[src]
fn extend_reserve(&mut self, additional: usize)
[src]
impl Hash for Command
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Command> for Command
[src]
impl StructuralEq for Command
[src]
impl StructuralPartialEq for Command
[src]
Auto Trait Implementations
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,