[][src]Struct async_mpd::MpdClient

pub struct MpdClient { /* fields omitted */ }

Mpd Client

Implementations

impl MpdClient[src]

pub async fn new<A: ToSocketAddrs>(addr: A) -> Result<Self, Error>[src]

Create a new MpdClient and connect to addr

pub async fn reconnect<'_>(&'_ mut self) -> Result<(), Error>[src]

Reconnect to server

pub async fn stats<'_>(&'_ mut self) -> Result<Stats, Error>[src]

Get stats on the music database

pub async fn status<'_>(&'_ mut self) -> Result<Status, Error>[src]

pub async fn update<'_, '_>(
    &'_ mut self,
    path: Option<&'_ str>
) -> Result<i32, Error>
[src]

pub async fn rescan<'_, '_>(
    &'_ mut self,
    path: Option<&'_ str>
) -> Result<i32, Error>
[src]

pub async fn idle<'_>(&'_ mut self) -> Result<Option<Subsystem>, Error>[src]

pub async fn noidle<'_>(&'_ mut self) -> Result<(), Error>[src]

pub async fn setvol<'_>(&'_ mut self, volume: u32) -> Result<(), Error>[src]

pub async fn repeat<'_>(&'_ mut self, repeat: bool) -> Result<(), Error>[src]

pub async fn random<'_>(&'_ mut self, random: bool) -> Result<(), Error>[src]

pub async fn consume<'_>(&'_ mut self, consume: bool) -> Result<(), Error>[src]

pub async fn play<'_>(&'_ mut self) -> Result<(), Error>[src]

pub async fn playid<'_>(&'_ mut self, id: u32) -> Result<(), Error>[src]

pub async fn pause<'_>(&'_ mut self) -> Result<(), Error>[src]

pub async fn play_pause<'_>(&'_ mut self, play: bool) -> Result<(), Error>[src]

pub async fn next<'_>(&'_ mut self) -> Result<(), Error>[src]

pub async fn prev<'_>(&'_ mut self) -> Result<(), Error>[src]

pub async fn stop<'_>(&'_ mut self) -> Result<(), Error>[src]

pub async fn listall<'_>(
    &'_ mut self,
    path: Option<String>
) -> Result<Vec<String>, Error>
[src]

pub async fn listallinfo<'_, '_>(
    &'_ mut self,
    path: Option<&'_ str>
) -> Result<Vec<Mixed>, Error>
[src]

pub async fn queue_add<'_, '_>(&'_ mut self, path: &'_ str) -> Result<(), Error>[src]

pub async fn queue_clear<'_>(&'_ mut self) -> Result<(), Error>[src]

pub async fn queue<'_>(&'_ mut self) -> Result<Vec<Track>, Error>[src]

pub async fn search<'_, '_>(
    &'_ mut self,
    filter: &'_ Filter
) -> Result<Vec<Track>, Error>
[src]

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("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(())
}

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.