Struct async_mpd::MpdClient [−][src]
pub struct MpdClient { /* fields omitted */ }
Expand description
Mpd Client
Implementations
Example
use async_mpd::{MpdClient, Error, Tag, Filter, ToFilterExpr};
#[async_std::main]
async fn main() -> Result<(), Error> {
// Connect to server
let mut mpd = MpdClient::new();
mpd.connect("localhost:6600").await?;
let mut filter = Filter::new()
.and(Tag::Artist.equals("The Beatles"))
.and(Tag::Album.contains("White"));
let res = mpd.search(&filter).await?;
println!("{:?}", res);
Ok(())
}
pub async fn exec_wrapped<C>(
&mut self,
cmd: C
) -> Result<WrappedResponse, Error> where
C: MpdCmd,
pub async fn exec_wrapped<C>(
&mut self,
cmd: C
) -> Result<WrappedResponse, Error> where
C: MpdCmd,
Execute a Mpd Command. Returns a enum wrapped Response