Struct mpd_protocol::command::Command
source · pub struct Command(/* private fields */);
Expand description
A single command, possibly including arguments.
Implementations§
source§impl Command
impl Command
sourcepub fn new(command: &str) -> Command
pub fn new(command: &str) -> Command
Start a new command.
Same as Command::build
, but panics on error instead of returning a result.
§Panics
Panics where Command::build
would return an error.
sourcepub fn argument<A: Argument>(self, argument: A) -> Command
pub fn argument<A: Argument>(self, argument: A) -> Command
Add an argument to the command.
Same as Command::add_argument
, but panics on error and allows chaining.
§Panics
Panics where Command::add_argument
would return an error.
sourcepub fn add_argument<A: Argument>(
&mut self,
argument: A
) -> Result<(), CommandError>
pub fn add_argument<A: Argument>( &mut self, argument: A ) -> Result<(), CommandError>
Add an argument to the command.
§Errors
An error is returned when the argument is invalid (e.g. empty string or containing invalid characters such as newlines).
Trait Implementations§
source§impl Extend<Command> for CommandList
impl Extend<Command> for CommandList
source§fn extend<T: IntoIterator<Item = Command>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Command>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl PartialEq for Command
impl PartialEq for Command
impl Eq for Command
impl StructuralPartialEq for Command
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§
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