examples/mpd-client: add some code
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user