Struct mpd_protocol::command::Command
source · [−]pub struct Command(_);Expand description
A single command, possibly including arguments.
Implementations
sourceimpl 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.
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.
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
sourceimpl Extend<Command> for CommandList
impl Extend<Command> for CommandList
sourcefn 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
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl PartialEq<Command> for Command
impl PartialEq<Command> for Command
impl Eq for Command
impl StructuralEq 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more