examples/mpd-client: add some code

This commit is contained in:
2025-12-08 13:00:46 +09:00
parent c5917c9827
commit 58fb7e6263
5 changed files with 17 additions and 7 deletions

View File

@@ -42,7 +42,7 @@ where
MpdClient { connection }
}
async fn read_initial_mpd_version(&mut self) -> Result<String, MpdClientError> {
pub async fn read_initial_mpd_version(&mut self) -> Result<String, MpdClientError> {
let mut reader = BufReader::new(&mut self.connection);
let mut version_line = String::new();
@@ -98,9 +98,7 @@ where
.map_err(MpdClientError::ConnectionError)?;
let response_bytes = self.read_response().await?;
let response = PlayResponse::parse_raw(&response_bytes)?;
Ok(response)
}
}

View File

@@ -428,7 +428,6 @@ pub(crate) use multi_item_command_response;
pub(crate) use single_item_command_request;
pub(crate) use single_item_command_response;
pub(crate) use single_optional_item_command_request;
use thiserror::Error;
#[derive(Debug, Clone, PartialEq)]
pub enum RequestParserError {

View File

@@ -14,7 +14,7 @@ mod server;
pub mod filter;
pub mod types;
pub use client::MpdClient;
pub use client::{MpdClient, MpdClientError};
pub use request::Request;
pub use response::Response;
pub use server::MpdServer;