commands: strip lifetimes
This commit is contained in:
@@ -38,7 +38,7 @@ pub use stickers::*;
|
||||
pub use stored_playlists::*;
|
||||
|
||||
/// A trait modelling a single MPD command request.
|
||||
pub trait CommandRequest<'a>
|
||||
pub trait CommandRequest
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
@@ -58,13 +58,13 @@ where
|
||||
|
||||
/// Parses the request from its tokenized parts.
|
||||
/// See also [`parse_raw`].
|
||||
fn parse(parts: RequestTokenizer<'a>) -> Result<Self, RequestParserError>;
|
||||
fn parse(parts: RequestTokenizer<'_>) -> Result<Self, RequestParserError>;
|
||||
|
||||
/// Parses the request from its raw string representation.
|
||||
///
|
||||
/// This assumes the raw string starts with the command name, e.g.
|
||||
/// `command_name arg1 "arg2 arg3"`
|
||||
fn parse_raw(raw: &'a str) -> Result<Self, RequestParserError> {
|
||||
fn parse_raw(raw: &str) -> Result<Self, RequestParserError> {
|
||||
let (line, rest) = raw
|
||||
.split_once('\n')
|
||||
.ok_or(RequestParserError::UnexpectedEOF)?;
|
||||
@@ -92,7 +92,7 @@ where
|
||||
}
|
||||
|
||||
/// A trait modelling a single MPD command response.
|
||||
pub trait CommandResponse<'a>
|
||||
pub trait CommandResponse
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
@@ -109,20 +109,20 @@ where
|
||||
|
||||
/// Parses the response from its tokenized parts.
|
||||
/// See also [`parse_raw`].
|
||||
fn parse(parts: ResponseAttributes<'a>) -> Result<Self, ResponseParserError>;
|
||||
fn parse(parts: ResponseAttributes<'_>) -> Result<Self, ResponseParserError>;
|
||||
|
||||
/// Parses the response from its raw byte representation.
|
||||
fn parse_raw(raw: &'a [u8]) -> Result<Self, ResponseParserError> {
|
||||
fn parse_raw(raw: &[u8]) -> Result<Self, ResponseParserError> {
|
||||
Self::parse(ResponseAttributes::new_from_bytes(raw))
|
||||
}
|
||||
}
|
||||
|
||||
/// A trait modelling the request/response pair of a single MPD command.
|
||||
pub trait Command<'req, 'res> {
|
||||
pub trait Command {
|
||||
/// The request sent from the client to the server
|
||||
type Request: CommandRequest<'req>;
|
||||
type Request: CommandRequest;
|
||||
/// The response sent from the server to the client
|
||||
type Response: CommandResponse<'res>;
|
||||
type Response: CommandResponse;
|
||||
|
||||
/// The command name used within the protocol
|
||||
const COMMAND: &'static str = Self::Request::COMMAND;
|
||||
@@ -138,13 +138,13 @@ pub trait Command<'req, 'res> {
|
||||
}
|
||||
|
||||
/// Parse the request from its tokenized parts. See also [`parse_raw_request`].
|
||||
fn parse_request(parts: RequestTokenizer<'req>) -> Result<Self::Request, RequestParserError> {
|
||||
fn parse_request(parts: RequestTokenizer) -> Result<Self::Request, RequestParserError> {
|
||||
Self::Request::parse(parts)
|
||||
}
|
||||
|
||||
/// Parse the raw request string into a request.
|
||||
/// This assumes the raw string starts with the command name, e.g. `command_name arg1 "arg2 arg3"`
|
||||
fn parse_raw_request(raw: &'req str) -> Result<Self::Request, RequestParserError> {
|
||||
fn parse_raw_request(raw: &str) -> Result<Self::Request, RequestParserError> {
|
||||
Self::Request::parse_raw(raw)
|
||||
}
|
||||
|
||||
@@ -152,13 +152,11 @@ pub trait Command<'req, 'res> {
|
||||
// fn serialize_response(&self, response: Self::Response) -> String {
|
||||
|
||||
/// Parse the response from its tokenized parts. See also [`parse_raw_response`].
|
||||
fn parse_response(
|
||||
parts: ResponseAttributes<'res>,
|
||||
) -> Result<Self::Response, ResponseParserError> {
|
||||
fn parse_response(parts: ResponseAttributes) -> Result<Self::Response, ResponseParserError> {
|
||||
Self::Response::parse(parts)
|
||||
}
|
||||
/// Parse the raw response string into a response.
|
||||
fn parse_raw_response(raw: &'res [u8]) -> Result<Self::Response, ResponseParserError> {
|
||||
fn parse_raw_response(raw: &[u8]) -> Result<Self::Response, ResponseParserError> {
|
||||
Self::Response::parse_raw(raw)
|
||||
}
|
||||
}
|
||||
@@ -172,7 +170,7 @@ macro_rules! empty_command_request {
|
||||
pub struct [<$name Request>];
|
||||
}
|
||||
|
||||
impl crate::commands::CommandRequest<'_> for paste::paste! { [<$name Request>] } {
|
||||
impl crate::commands::CommandRequest for paste::paste! { [<$name Request>] } {
|
||||
const COMMAND: &'static str = $command_name;
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -213,7 +211,7 @@ macro_rules! empty_command_response {
|
||||
pub struct [<$name Response>];
|
||||
}
|
||||
|
||||
impl crate::commands::CommandResponse<'_> for paste::paste! { [<$name Response>] } {
|
||||
impl crate::commands::CommandResponse for paste::paste! { [<$name Response>] } {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -239,7 +237,7 @@ macro_rules! single_item_command_request {
|
||||
pub struct [<$name Request>] ($item_type);
|
||||
}
|
||||
|
||||
impl crate::commands::CommandRequest<'_> for paste::paste! { [<$name Request>] } {
|
||||
impl crate::commands::CommandRequest for paste::paste! { [<$name Request>] } {
|
||||
const COMMAND: &'static str = $command_name;
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -287,7 +285,7 @@ macro_rules! single_optional_item_command_request {
|
||||
pub struct [<$name Request>] (Option<$item_type>);
|
||||
}
|
||||
|
||||
impl crate::commands::CommandRequest<'_> for paste::paste! { [<$name Request>] } {
|
||||
impl crate::commands::CommandRequest for paste::paste! { [<$name Request>] } {
|
||||
const COMMAND: &'static str = $command_name;
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -340,7 +338,7 @@ macro_rules! single_item_command_response {
|
||||
pub struct [<$name Response>] ( $item_type );
|
||||
}
|
||||
|
||||
impl crate::commands::CommandResponse<'_> for paste::paste! { [<$name Response>] } {
|
||||
impl crate::commands::CommandResponse for paste::paste! { [<$name Response>] } {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -384,7 +382,7 @@ macro_rules! multi_item_command_response {
|
||||
pub struct [<$name Response>] ( Vec<$item_type> );
|
||||
}
|
||||
|
||||
impl crate::commands::CommandResponse<'_> for paste::paste! { [<$name Response>] } {
|
||||
impl crate::commands::CommandResponse for paste::paste! { [<$name Response>] } {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(DisableOutput, "disableoutput", AudioOutputId);
|
||||
|
||||
empty_command_response!(DisableOutput);
|
||||
|
||||
impl Command<'_, '_> for DisableOutput {
|
||||
impl Command for DisableOutput {
|
||||
type Request = DisableOutputRequest;
|
||||
type Response = DisableOutputResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(EnableOutput, "enableoutput", AudioOutputId);
|
||||
|
||||
empty_command_response!(EnableOutput);
|
||||
|
||||
impl Command<'_, '_> for EnableOutput {
|
||||
impl Command for EnableOutput {
|
||||
type Request = EnableOutputRequest;
|
||||
type Response = EnableOutputResponse;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ pub struct Output {
|
||||
pub attribute: HashMap<String, String>,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for OutputsResponse {
|
||||
impl CommandResponse for OutputsResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -113,7 +113,7 @@ impl CommandResponse<'_> for OutputsResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for Outputs {
|
||||
impl Command for Outputs {
|
||||
type Request = OutputsRequest;
|
||||
type Response = OutputsResponse;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ pub struct OutputSetRequest {
|
||||
pub attribute_value: String,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for OutputSetRequest {
|
||||
impl CommandRequest for OutputSetRequest {
|
||||
const COMMAND: &'static str = "outputset";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -65,7 +65,7 @@ impl CommandRequest<'_> for OutputSetRequest {
|
||||
|
||||
empty_command_response!(OutputSet);
|
||||
|
||||
impl Command<'_, '_> for OutputSet {
|
||||
impl Command for OutputSet {
|
||||
type Request = OutputSetRequest;
|
||||
type Response = OutputSetResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(ToggleOutput, "toggleoutput", AudioOutputId);
|
||||
|
||||
empty_command_response!(ToggleOutput);
|
||||
|
||||
impl Command<'_, '_> for ToggleOutput {
|
||||
impl Command for ToggleOutput {
|
||||
type Request = ToggleOutputRequest;
|
||||
type Response = ToggleOutputResponse;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ pub struct ChannelsResponse {
|
||||
pub channels: Vec<ChannelName>,
|
||||
}
|
||||
|
||||
impl<'a> CommandResponse<'a> for ChannelsResponse {
|
||||
impl CommandResponse for ChannelsResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -42,7 +42,7 @@ impl<'a> CommandResponse<'a> for ChannelsResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for Channels {
|
||||
impl Command for Channels {
|
||||
type Request = ChannelsRequest;
|
||||
type Response = ChannelsResponse;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ pub struct ReadMessagesResponseEntry {
|
||||
message: String,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for ReadMessagesResponse {
|
||||
impl CommandResponse for ReadMessagesResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -55,7 +55,7 @@ impl CommandResponse<'_> for ReadMessagesResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for ReadMessages {
|
||||
impl Command for ReadMessages {
|
||||
type Request = ReadMessagesRequest;
|
||||
type Response = ReadMessagesResponse;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct SendMessageRequest {
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for SendMessageRequest {
|
||||
impl CommandRequest for SendMessageRequest {
|
||||
const COMMAND: &'static str = "sendmessage";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -51,7 +51,7 @@ impl CommandRequest<'_> for SendMessageRequest {
|
||||
|
||||
empty_command_response!(SendMessage);
|
||||
|
||||
impl Command<'_, '_> for SendMessage {
|
||||
impl Command for SendMessage {
|
||||
type Request = SendMessageRequest;
|
||||
type Response = SendMessageResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(Subscribe, "subscribe", ChannelName);
|
||||
|
||||
empty_command_response!(Subscribe);
|
||||
|
||||
impl Command<'_, '_> for Subscribe {
|
||||
impl Command for Subscribe {
|
||||
type Request = SubscribeRequest;
|
||||
type Response = SubscribeResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(Unsubscribe, "unsubscribe", ChannelName);
|
||||
|
||||
empty_command_response!(Unsubscribe);
|
||||
|
||||
impl Command<'_, '_> for Unsubscribe {
|
||||
impl Command for Unsubscribe {
|
||||
type Request = UnsubscribeRequest;
|
||||
type Response = UnsubscribeResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ single_item_command_request!(BinaryLimit, "binarylimit", u64);
|
||||
|
||||
empty_command_response!(BinaryLimit);
|
||||
|
||||
impl Command<'_, '_> for BinaryLimit {
|
||||
impl Command for BinaryLimit {
|
||||
type Request = BinaryLimitRequest;
|
||||
type Response = BinaryLimitResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ empty_command_request!(Close, "close");
|
||||
|
||||
empty_command_response!(Close);
|
||||
|
||||
impl Command<'_, '_> for Close {
|
||||
impl Command for Close {
|
||||
type Request = CloseRequest;
|
||||
type Response = CloseResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ empty_command_request!(Kill, "kill");
|
||||
|
||||
empty_command_response!(Kill);
|
||||
|
||||
impl Command<'_, '_> for Kill {
|
||||
impl Command for Kill {
|
||||
type Request = KillRequest;
|
||||
type Response = KillResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ single_item_command_request!(Password, "password", String);
|
||||
|
||||
empty_command_response!(Password);
|
||||
|
||||
impl Command<'_, '_> for Password {
|
||||
impl Command for Password {
|
||||
type Request = PasswordRequest;
|
||||
type Response = PasswordResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ empty_command_request!(Ping, "ping");
|
||||
|
||||
empty_command_response!(Ping);
|
||||
|
||||
impl Command<'_, '_> for Ping {
|
||||
impl Command for Ping {
|
||||
type Request = PingRequest;
|
||||
type Response = PingResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ empty_command_request!(Protocol, "protocol");
|
||||
|
||||
multi_item_command_response!(Protocol, "feature", String);
|
||||
|
||||
impl Command<'_, '_> for Protocol {
|
||||
impl Command for Protocol {
|
||||
type Request = ProtocolRequest;
|
||||
type Response = ProtocolResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ empty_command_request!(ProtocolAll, "protocol all");
|
||||
|
||||
empty_command_response!(ProtocolAll);
|
||||
|
||||
impl Command<'_, '_> for ProtocolAll {
|
||||
impl Command for ProtocolAll {
|
||||
type Request = ProtocolAllRequest;
|
||||
type Response = ProtocolAllResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ empty_command_request!(ProtocolAvailable, "protocol available");
|
||||
|
||||
multi_item_command_response!(ProtocolAvailable, "feature", String);
|
||||
|
||||
impl Command<'_, '_> for ProtocolAvailable {
|
||||
impl Command for ProtocolAvailable {
|
||||
type Request = ProtocolAvailableRequest;
|
||||
type Response = ProtocolAvailableResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ empty_command_request!(ProtocolClear, "protocol clear");
|
||||
|
||||
empty_command_response!(ProtocolClear);
|
||||
|
||||
impl Command<'_, '_> for ProtocolClear {
|
||||
impl Command for ProtocolClear {
|
||||
type Request = ProtocolClearRequest;
|
||||
type Response = ProtocolClearResponse;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ pub struct ProtocolDisable;
|
||||
|
||||
pub struct ProtocolDisableRequest(Vec<Feature>);
|
||||
|
||||
impl CommandRequest<'_> for ProtocolDisableRequest {
|
||||
impl CommandRequest for ProtocolDisableRequest {
|
||||
const COMMAND: &'static str = "protocol disable";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -52,7 +52,7 @@ impl CommandRequest<'_> for ProtocolDisableRequest {
|
||||
|
||||
empty_command_response!(ProtocolDisable);
|
||||
|
||||
impl Command<'_, '_> for ProtocolDisable {
|
||||
impl Command for ProtocolDisable {
|
||||
type Request = ProtocolDisableRequest;
|
||||
type Response = ProtocolDisableResponse;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ pub struct ProtocolEnable;
|
||||
|
||||
pub struct ProtocolEnableRequest(Vec<Feature>);
|
||||
|
||||
impl CommandRequest<'_> for ProtocolEnableRequest {
|
||||
impl CommandRequest for ProtocolEnableRequest {
|
||||
const COMMAND: &'static str = "protocol enable";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -52,7 +52,7 @@ impl CommandRequest<'_> for ProtocolEnableRequest {
|
||||
|
||||
empty_command_response!(ProtocolEnable);
|
||||
|
||||
impl Command<'_, '_> for ProtocolEnable {
|
||||
impl Command for ProtocolEnable {
|
||||
type Request = ProtocolEnableRequest;
|
||||
type Response = ProtocolEnableResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ empty_command_request!(TagTypes, "tagtypes");
|
||||
|
||||
multi_item_command_response!(TagTypes, "tagtype", String);
|
||||
|
||||
impl Command<'_, '_> for TagTypes {
|
||||
impl Command for TagTypes {
|
||||
type Request = TagTypesRequest;
|
||||
type Response = TagTypesResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ empty_command_request!(TagTypesAll, "tagtypes all");
|
||||
|
||||
empty_command_response!(TagTypesAll);
|
||||
|
||||
impl Command<'_, '_> for TagTypesAll {
|
||||
impl Command for TagTypesAll {
|
||||
type Request = TagTypesAllRequest;
|
||||
type Response = TagTypesAllResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ empty_command_request!(TagTypesAvailable, "tagtypes available");
|
||||
|
||||
multi_item_command_response!(TagTypesAvailable, "tagtype", String);
|
||||
|
||||
impl Command<'_, '_> for TagTypesAvailable {
|
||||
impl Command for TagTypesAvailable {
|
||||
type Request = TagTypesAvailableRequest;
|
||||
type Response = TagTypesAvailableResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ empty_command_request!(TagTypesClear, "tagtypes clear");
|
||||
|
||||
empty_command_response!(TagTypesClear);
|
||||
|
||||
impl Command<'_, '_> for TagTypesClear {
|
||||
impl Command for TagTypesClear {
|
||||
type Request = TagTypesClearRequest;
|
||||
type Response = TagTypesClearResponse;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ pub struct TagTypesDisable;
|
||||
|
||||
pub struct TagTypesDisableRequest(Vec<TagName>);
|
||||
|
||||
impl CommandRequest<'_> for TagTypesDisableRequest {
|
||||
impl CommandRequest for TagTypesDisableRequest {
|
||||
const COMMAND: &'static str = "tagtypes disable";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -53,7 +53,7 @@ impl CommandRequest<'_> for TagTypesDisableRequest {
|
||||
|
||||
empty_command_response!(TagTypesDisable);
|
||||
|
||||
impl Command<'_, '_> for TagTypesDisable {
|
||||
impl Command for TagTypesDisable {
|
||||
type Request = TagTypesDisableRequest;
|
||||
type Response = TagTypesDisableResponse;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ pub struct TagTypesEnable;
|
||||
|
||||
pub struct TagTypesEnableRequest(Vec<TagName>);
|
||||
|
||||
impl CommandRequest<'_> for TagTypesEnableRequest {
|
||||
impl CommandRequest for TagTypesEnableRequest {
|
||||
const COMMAND: &'static str = "tagtypes enable";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -53,7 +53,7 @@ impl CommandRequest<'_> for TagTypesEnableRequest {
|
||||
|
||||
empty_command_response!(TagTypesEnable);
|
||||
|
||||
impl Command<'_, '_> for TagTypesEnable {
|
||||
impl Command for TagTypesEnable {
|
||||
type Request = TagTypesEnableRequest;
|
||||
type Response = TagTypesEnableResponse;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ pub struct TagTypesReset;
|
||||
|
||||
pub struct TagTypesResetRequest(Vec<TagName>);
|
||||
|
||||
impl CommandRequest<'_> for TagTypesResetRequest {
|
||||
impl CommandRequest for TagTypesResetRequest {
|
||||
const COMMAND: &'static str = "tagtypes reset";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -53,7 +53,7 @@ impl CommandRequest<'_> for TagTypesResetRequest {
|
||||
|
||||
empty_command_response!(TagTypesReset);
|
||||
|
||||
impl Command<'_, '_> for TagTypesReset {
|
||||
impl Command for TagTypesReset {
|
||||
type Request = TagTypesResetRequest;
|
||||
type Response = TagTypesResetResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ empty_command_request!(Next, "next");
|
||||
|
||||
empty_command_response!(Next);
|
||||
|
||||
impl Command<'_, '_> for Next {
|
||||
impl Command for Next {
|
||||
type Request = NextRequest;
|
||||
type Response = NextResponse;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ pub struct Pause;
|
||||
|
||||
pub struct PauseRequest(Option<bool>);
|
||||
|
||||
impl CommandRequest<'_> for PauseRequest {
|
||||
impl CommandRequest for PauseRequest {
|
||||
const COMMAND: &'static str = "pause";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -45,7 +45,7 @@ impl CommandRequest<'_> for PauseRequest {
|
||||
|
||||
empty_command_response!(Pause);
|
||||
|
||||
impl Command<'_, '_> for Pause {
|
||||
impl Command for Pause {
|
||||
type Request = PauseRequest;
|
||||
type Response = PauseResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_optional_item_command_request!(Play, "play", SongPosition);
|
||||
|
||||
empty_command_response!(Play);
|
||||
|
||||
impl Command<'_, '_> for Play {
|
||||
impl Command for Play {
|
||||
type Request = PlayRequest;
|
||||
type Response = PlayResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_optional_item_command_request!(PlayId, "playid", SongId);
|
||||
|
||||
empty_command_response!(PlayId);
|
||||
|
||||
impl Command<'_, '_> for PlayId {
|
||||
impl Command for PlayId {
|
||||
type Request = PlayIdRequest;
|
||||
type Response = PlayIdResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ empty_command_request!(Previous, "previous");
|
||||
|
||||
empty_command_response!(Previous);
|
||||
|
||||
impl Command<'_, '_> for Previous {
|
||||
impl Command for Previous {
|
||||
type Request = PreviousRequest;
|
||||
type Response = PreviousResponse;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct SeekRequest {
|
||||
pub time: TimeWithFractions,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for SeekRequest {
|
||||
impl CommandRequest for SeekRequest {
|
||||
const COMMAND: &'static str = "seek";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -55,7 +55,7 @@ impl CommandRequest<'_> for SeekRequest {
|
||||
|
||||
empty_command_response!(Seek);
|
||||
|
||||
impl Command<'_, '_> for Seek {
|
||||
impl Command for Seek {
|
||||
type Request = SeekRequest;
|
||||
type Response = SeekResponse;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct SeekCurRequest {
|
||||
pub time: TimeWithFractions,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for SeekCurRequest {
|
||||
impl CommandRequest for SeekCurRequest {
|
||||
const COMMAND: &'static str = "seekcur";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -75,7 +75,7 @@ impl CommandRequest<'_> for SeekCurRequest {
|
||||
|
||||
empty_command_response!(SeekCur);
|
||||
|
||||
impl Command<'_, '_> for SeekCur {
|
||||
impl Command for SeekCur {
|
||||
type Request = SeekCurRequest;
|
||||
type Response = SeekCurResponse;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct SeekIdRequest {
|
||||
pub time: TimeWithFractions,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for SeekIdRequest {
|
||||
impl CommandRequest for SeekIdRequest {
|
||||
const COMMAND: &'static str = "seekid";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -55,7 +55,7 @@ impl CommandRequest<'_> for SeekIdRequest {
|
||||
|
||||
empty_command_response!(SeekId);
|
||||
|
||||
impl Command<'_, '_> for SeekId {
|
||||
impl Command for SeekId {
|
||||
type Request = SeekIdRequest;
|
||||
type Response = SeekIdResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ empty_command_request!(Stop, "stop");
|
||||
|
||||
empty_command_response!(Stop);
|
||||
|
||||
impl Command<'_, '_> for Stop {
|
||||
impl Command for Stop {
|
||||
type Request = StopRequest;
|
||||
type Response = StopResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ empty_command_request!(ListMounts, "listmounts");
|
||||
|
||||
multi_item_command_response!(ListMounts, "mount", String);
|
||||
|
||||
impl Command<'_, '_> for ListMounts {
|
||||
impl Command for ListMounts {
|
||||
type Request = ListMountsRequest;
|
||||
type Response = ListMountsResponse;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ empty_command_request!(ListNeighbors, "listneighbors");
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ListNeighborsResponse(HashMap<String, String>);
|
||||
|
||||
impl CommandResponse<'_> for ListNeighborsResponse {
|
||||
impl CommandResponse for ListNeighborsResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -46,7 +46,7 @@ impl CommandResponse<'_> for ListNeighborsResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for ListNeighbors {
|
||||
impl Command for ListNeighbors {
|
||||
type Request = ListNeighborsRequest;
|
||||
type Response = ListNeighborsResponse;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct MountRequest {
|
||||
pub uri: Uri,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for MountRequest {
|
||||
impl CommandRequest for MountRequest {
|
||||
const COMMAND: &'static str = "mount";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -57,7 +57,7 @@ impl CommandRequest<'_> for MountRequest {
|
||||
|
||||
empty_command_response!(Mount);
|
||||
|
||||
impl Command<'_, '_> for Mount {
|
||||
impl Command for Mount {
|
||||
type Request = MountRequest;
|
||||
type Response = MountResponse;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ pub struct Unmount;
|
||||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct UnmountRequest(MountPath);
|
||||
|
||||
impl CommandRequest<'_> for UnmountRequest {
|
||||
impl CommandRequest for UnmountRequest {
|
||||
const COMMAND: &'static str = "unmount";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -47,7 +47,7 @@ impl CommandRequest<'_> for UnmountRequest {
|
||||
|
||||
empty_command_response!(Unmount);
|
||||
|
||||
impl Command<'_, '_> for Unmount {
|
||||
impl Command for Unmount {
|
||||
type Request = UnmountRequest;
|
||||
type Response = UnmountResponse;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ pub struct AlbumArtRequest {
|
||||
offset: Offset,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for AlbumArtRequest {
|
||||
impl CommandRequest for AlbumArtRequest {
|
||||
const COMMAND: &'static str = "albumart";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -63,7 +63,7 @@ pub struct AlbumArtResponse {
|
||||
pub binary: Vec<u8>,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for AlbumArtResponse {
|
||||
impl CommandResponse for AlbumArtResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -83,7 +83,7 @@ impl CommandResponse<'_> for AlbumArtResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for AlbumArt {
|
||||
impl Command for AlbumArt {
|
||||
type Request = AlbumArtRequest;
|
||||
type Response = AlbumArtResponse;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ pub struct CountRequest {
|
||||
group: Option<GroupType>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for CountRequest {
|
||||
impl CommandRequest for CountRequest {
|
||||
const COMMAND: &'static str = "count";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -37,7 +37,7 @@ impl CommandRequest<'_> for CountRequest {
|
||||
if let Some(group) = self.group.as_ref() {
|
||||
cmd.push_str(&format!(" group {}", group));
|
||||
}
|
||||
cmd.push_str("\n");
|
||||
cmd.push('\n');
|
||||
cmd
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ pub struct CountResponse {
|
||||
pub playtime: u64,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for CountResponse {
|
||||
impl CommandResponse for CountResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -92,7 +92,7 @@ impl CommandResponse<'_> for CountResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for Count {
|
||||
impl Command for Count {
|
||||
type Request = CountRequest;
|
||||
type Response = CountResponse;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ pub struct FindRequest {
|
||||
window: Option<WindowRange>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for FindRequest {
|
||||
impl CommandRequest for FindRequest {
|
||||
const COMMAND: &'static str = "find";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -43,7 +43,7 @@ impl CommandRequest<'_> for FindRequest {
|
||||
if let Some(window) = &self.window {
|
||||
cmd.push_str(&format!(" window {}", window));
|
||||
}
|
||||
cmd.push_str("\n");
|
||||
cmd.push('\n');
|
||||
cmd
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ impl CommandRequest<'_> for FindRequest {
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct FindResponse(Vec<DbSongInfo>);
|
||||
|
||||
impl CommandResponse<'_> for FindResponse {
|
||||
impl CommandResponse for FindResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -114,7 +114,7 @@ impl CommandResponse<'_> for FindResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for Find {
|
||||
impl Command for Find {
|
||||
type Request = FindRequest;
|
||||
type Response = FindResponse;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ pub struct FindAddRequest {
|
||||
position: Option<SongPosition>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for FindAddRequest {
|
||||
impl CommandRequest for FindAddRequest {
|
||||
const COMMAND: &'static str = "findadd";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -47,7 +47,7 @@ impl CommandRequest<'_> for FindAddRequest {
|
||||
if let Some(position) = &self.position {
|
||||
cmd.push_str(&format!(" position {}", position));
|
||||
}
|
||||
cmd.push_str("\n");
|
||||
cmd.push('\n');
|
||||
cmd
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ impl CommandRequest<'_> for FindAddRequest {
|
||||
|
||||
empty_command_response!(FindAdd);
|
||||
|
||||
impl Command<'_, '_> for FindAdd {
|
||||
impl Command for FindAdd {
|
||||
type Request = FindAddRequest;
|
||||
type Response = FindAddResponse;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ pub struct GetFingerprintResponse {
|
||||
pub chromaprint: String,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for GetFingerprintResponse {
|
||||
impl CommandResponse for GetFingerprintResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -35,7 +35,7 @@ impl CommandResponse<'_> for GetFingerprintResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for GetFingerprint {
|
||||
impl Command for GetFingerprint {
|
||||
type Request = GetFingerprintRequest;
|
||||
type Response = GetFingerprintResponse;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ pub struct ListRequest {
|
||||
window: Option<WindowRange>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for ListRequest {
|
||||
impl CommandRequest for ListRequest {
|
||||
const COMMAND: &'static str = "list";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -48,7 +48,7 @@ impl CommandRequest<'_> for ListRequest {
|
||||
if let Some(window) = &self.window {
|
||||
cmd.push_str(&format!(" window {}", window));
|
||||
}
|
||||
cmd.push_str("\n");
|
||||
cmd.push('\n');
|
||||
cmd
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ impl CommandRequest<'_> for ListRequest {
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ListResponse(Vec<String>);
|
||||
|
||||
impl CommandResponse<'_> for ListResponse {
|
||||
impl CommandResponse for ListResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -134,7 +134,7 @@ impl CommandResponse<'_> for ListResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for List {
|
||||
impl Command for List {
|
||||
type Request = ListRequest;
|
||||
type Response = ListResponse;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, CommandResponse, RequestParserError, ResponseParserError,
|
||||
Command, CommandResponse, ResponseParserError,
|
||||
single_optional_item_command_request,
|
||||
},
|
||||
response_tokenizer::ResponseAttributes,
|
||||
@@ -17,7 +17,7 @@ single_optional_item_command_request!(ListAll, "listall", Uri);
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ListAllResponse(Vec<DbSelectionPrintResponse>);
|
||||
|
||||
impl CommandResponse<'_> for ListAllResponse {
|
||||
impl CommandResponse for ListAllResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -33,7 +33,7 @@ impl CommandResponse<'_> for ListAllResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for ListAll {
|
||||
impl Command for ListAll {
|
||||
type Request = ListAllRequest;
|
||||
type Response = ListAllResponse;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, CommandResponse, RequestParserError, ResponseParserError,
|
||||
Command, CommandResponse, ResponseParserError,
|
||||
single_optional_item_command_request,
|
||||
},
|
||||
response_tokenizer::ResponseAttributes,
|
||||
@@ -17,7 +17,7 @@ single_optional_item_command_request!(ListAllInfo, "listallinfo", Uri);
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ListAllInfoResponse(Vec<DbSelectionPrintResponse>);
|
||||
|
||||
impl CommandResponse<'_> for ListAllInfoResponse {
|
||||
impl CommandResponse for ListAllInfoResponse {
|
||||
fn from_response_enum(response: crate::Response) -> Option<Self> {
|
||||
todo!()
|
||||
}
|
||||
@@ -33,7 +33,7 @@ impl CommandResponse<'_> for ListAllInfoResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for ListAllInfo {
|
||||
impl Command for ListAllInfo {
|
||||
type Request = ListAllInfoRequest;
|
||||
type Response = ListAllInfoResponse;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, CommandResponse, RequestParserError, ResponseParserError,
|
||||
Command, CommandResponse, ResponseParserError,
|
||||
single_optional_item_command_request,
|
||||
},
|
||||
response_tokenizer::ResponseAttributes,
|
||||
@@ -16,7 +16,7 @@ single_optional_item_command_request!(ListFiles, "listfiles", Uri);
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ListFilesResponse(Vec<DbDirectoryInfo>);
|
||||
|
||||
impl CommandResponse<'_> for ListFilesResponse {
|
||||
impl CommandResponse for ListFilesResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -42,7 +42,7 @@ impl CommandResponse<'_> for ListFilesResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for ListFiles {
|
||||
impl Command for ListFiles {
|
||||
type Request = ListFilesRequest;
|
||||
type Response = ListFilesResponse;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, CommandResponse, RequestParserError, ResponseParserError,
|
||||
Command, CommandResponse, ResponseParserError,
|
||||
single_optional_item_command_request,
|
||||
},
|
||||
response_tokenizer::ResponseAttributes,
|
||||
@@ -16,7 +16,7 @@ single_optional_item_command_request!(LsInfo, "lsinfo", Uri);
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct LsInfoResponse(Vec<DbSelectionPrintResponse>);
|
||||
|
||||
impl CommandResponse<'_> for LsInfoResponse {
|
||||
impl CommandResponse for LsInfoResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -32,7 +32,7 @@ impl CommandResponse<'_> for LsInfoResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for LsInfo {
|
||||
impl Command for LsInfo {
|
||||
type Request = LsInfoRequest;
|
||||
type Response = LsInfoResponse;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ single_item_command_request!(ReadComments, "readcomments", Uri);
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ReadCommentsResponse(HashMap<String, String>);
|
||||
|
||||
impl CommandResponse<'_> for ReadCommentsResponse {
|
||||
impl CommandResponse for ReadCommentsResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -41,7 +41,7 @@ impl CommandResponse<'_> for ReadCommentsResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for ReadComments {
|
||||
impl Command for ReadComments {
|
||||
type Request = ReadCommentsRequest;
|
||||
type Response = ReadCommentsResponse;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ pub struct ReadPictureRequest {
|
||||
pub offset: Offset,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for ReadPictureRequest {
|
||||
impl CommandRequest for ReadPictureRequest {
|
||||
const COMMAND: &'static str = "readpicture";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -66,7 +66,7 @@ pub struct ReadPictureResponse {
|
||||
pub mimetype: Option<String>,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for ReadPictureResponse {
|
||||
impl CommandResponse for ReadPictureResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -97,7 +97,7 @@ impl CommandResponse<'_> for ReadPictureResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for ReadPicture {
|
||||
impl Command for ReadPicture {
|
||||
type Request = ReadPictureRequest;
|
||||
type Response = ReadPictureResponse;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, CommandResponse, RequestParserError, ResponseParserError,
|
||||
Command, CommandResponse, ResponseParserError,
|
||||
single_optional_item_command_request,
|
||||
},
|
||||
response_tokenizer::{ResponseAttributes, get_and_parse_property},
|
||||
@@ -20,7 +20,7 @@ pub struct RescanResponse {
|
||||
pub updating_db: usize,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for RescanResponse {
|
||||
impl CommandResponse for RescanResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -38,7 +38,7 @@ impl CommandResponse<'_> for RescanResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for Rescan {
|
||||
impl Command for Rescan {
|
||||
type Request = RescanRequest;
|
||||
type Response = RescanResponse;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ pub struct SearchRequest {
|
||||
window: Option<WindowRange>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for SearchRequest {
|
||||
impl CommandRequest for SearchRequest {
|
||||
const COMMAND: &'static str = "search";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -43,7 +43,7 @@ impl CommandRequest<'_> for SearchRequest {
|
||||
if let Some(window) = &self.window {
|
||||
cmd.push_str(&format!(" window {}", window));
|
||||
}
|
||||
cmd.push_str("\n");
|
||||
cmd.push('\n');
|
||||
cmd
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ impl CommandRequest<'_> for SearchRequest {
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct SearchResponse(Vec<DbSongInfo>);
|
||||
|
||||
impl CommandResponse<'_> for SearchResponse {
|
||||
impl CommandResponse for SearchResponse {
|
||||
fn from_response_enum(response: crate::Response) -> Option<Self> {
|
||||
todo!()
|
||||
}
|
||||
@@ -114,7 +114,7 @@ impl CommandResponse<'_> for SearchResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for Search {
|
||||
impl Command for Search {
|
||||
type Request = SearchRequest;
|
||||
type Response = SearchResponse;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ pub struct SearchAddRequest {
|
||||
position: Option<SongPosition>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for SearchAddRequest {
|
||||
impl CommandRequest for SearchAddRequest {
|
||||
const COMMAND: &'static str = "searchadd";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -47,7 +47,7 @@ impl CommandRequest<'_> for SearchAddRequest {
|
||||
if let Some(position) = &self.position {
|
||||
cmd.push_str(&format!(" position {}", position));
|
||||
}
|
||||
cmd.push_str("\n");
|
||||
cmd.push('\n');
|
||||
cmd
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ impl CommandRequest<'_> for SearchAddRequest {
|
||||
|
||||
empty_command_response!(SearchAdd);
|
||||
|
||||
impl Command<'_, '_> for SearchAdd {
|
||||
impl Command for SearchAdd {
|
||||
type Request = SearchAddRequest;
|
||||
type Response = SearchAddResponse;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ pub struct SearchAddPlRequest {
|
||||
position: Option<SongPosition>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for SearchAddPlRequest {
|
||||
impl CommandRequest for SearchAddPlRequest {
|
||||
const COMMAND: &'static str = "searchaddpl";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -57,7 +57,7 @@ impl CommandRequest<'_> for SearchAddPlRequest {
|
||||
if let Some(position) = &self.position {
|
||||
cmd.push_str(&format!(" position {}", position));
|
||||
}
|
||||
cmd.push_str("\n");
|
||||
cmd.push('\n');
|
||||
cmd
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ impl CommandRequest<'_> for SearchAddPlRequest {
|
||||
|
||||
empty_command_response!(SearchAddPl);
|
||||
|
||||
impl Command<'_, '_> for SearchAddPl {
|
||||
impl Command for SearchAddPl {
|
||||
type Request = SearchAddPlRequest;
|
||||
type Response = SearchAddPlResponse;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ pub struct SearchCountRequest {
|
||||
group: Option<GroupType>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for SearchCountRequest {
|
||||
impl CommandRequest for SearchCountRequest {
|
||||
const COMMAND: &'static str = "searchcount";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -39,7 +39,7 @@ impl CommandRequest<'_> for SearchCountRequest {
|
||||
if let Some(group) = &self.group {
|
||||
cmd.push_str(&format!(" group {}", group));
|
||||
}
|
||||
cmd.push_str("\n");
|
||||
cmd.push('\n');
|
||||
cmd
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ pub struct SearchCountResponse {
|
||||
pub playtime: Seconds,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for SearchCountResponse {
|
||||
impl CommandResponse for SearchCountResponse {
|
||||
fn from_response_enum(response: crate::Response) -> Option<Self> {
|
||||
todo!()
|
||||
}
|
||||
@@ -93,7 +93,7 @@ impl CommandResponse<'_> for SearchCountResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for SearchCount {
|
||||
impl Command for SearchCount {
|
||||
type Request = SearchCountRequest;
|
||||
type Response = SearchCountResponse;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, CommandResponse, RequestParserError, ResponseParserError,
|
||||
Command, CommandResponse, ResponseParserError,
|
||||
single_optional_item_command_request,
|
||||
},
|
||||
response_tokenizer::{ResponseAttributes, get_and_parse_property},
|
||||
@@ -20,7 +20,7 @@ pub struct UpdateResponse {
|
||||
updating_db: usize,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for UpdateResponse {
|
||||
impl CommandResponse for UpdateResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -38,7 +38,7 @@ impl CommandResponse<'_> for UpdateResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for Update {
|
||||
impl Command for Update {
|
||||
type Request = UpdateRequest;
|
||||
type Response = UpdateResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(DelPartition, "delpartition", PartitionName);
|
||||
|
||||
empty_command_response!(DelPartition);
|
||||
|
||||
impl Command<'_, '_> for DelPartition {
|
||||
impl Command for DelPartition {
|
||||
type Request = DelPartitionRequest;
|
||||
type Response = DelPartitionResponse;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ empty_command_request!(ListPartitions, "listpartitions");
|
||||
|
||||
multi_item_command_response!(ListPartitions, "partition", PartitionName);
|
||||
|
||||
impl Command<'_, '_> for ListPartitions {
|
||||
impl Command for ListPartitions {
|
||||
type Request = ListPartitionsRequest;
|
||||
type Response = ListPartitionsResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ single_item_command_request!(MoveOutput, "moveoutput", String);
|
||||
|
||||
empty_command_response!(MoveOutput);
|
||||
|
||||
impl Command<'_, '_> for MoveOutput {
|
||||
impl Command for MoveOutput {
|
||||
type Request = MoveOutputRequest;
|
||||
type Response = MoveOutputResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(NewPartition, "newpartition", PartitionName);
|
||||
|
||||
empty_command_response!(NewPartition);
|
||||
|
||||
impl Command<'_, '_> for NewPartition {
|
||||
impl Command for NewPartition {
|
||||
type Request = NewPartitionRequest;
|
||||
type Response = NewPartitionResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(Partition, "partition", PartitionName);
|
||||
|
||||
empty_command_response!(Partition);
|
||||
|
||||
impl Command<'_, '_> for Partition {
|
||||
impl Command for Partition {
|
||||
type Request = PartitionRequest;
|
||||
type Response = PartitionResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(Consume, "consume", BoolOrOneshot);
|
||||
|
||||
empty_command_response!(Consume);
|
||||
|
||||
impl Command<'_, '_> for Consume {
|
||||
impl Command for Consume {
|
||||
type Request = ConsumeRequest;
|
||||
type Response = ConsumeResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(Crossfade, "crossfade", Seconds);
|
||||
|
||||
empty_command_response!(Crossfade);
|
||||
|
||||
impl Command<'_, '_> for Crossfade {
|
||||
impl Command for Crossfade {
|
||||
type Request = CrossfadeRequest;
|
||||
type Response = CrossfadeResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ empty_command_request!(GetVol, "getvol");
|
||||
|
||||
single_item_command_response!(GetVol, "volume", VolumeValue);
|
||||
|
||||
impl Command<'_, '_> for GetVol {
|
||||
impl Command for GetVol {
|
||||
type Request = GetVolRequest;
|
||||
type Response = GetVolResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ single_item_command_request!(MixRampDb, "mixrampdb", f32);
|
||||
|
||||
empty_command_response!(MixRampDb);
|
||||
|
||||
impl Command<'_, '_> for MixRampDb {
|
||||
impl Command for MixRampDb {
|
||||
type Request = MixRampDbRequest;
|
||||
type Response = MixRampDbResponse;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ pub struct MixRampDelay;
|
||||
single_item_command_request!(MixRampDelay, "mixrampdelay", Seconds);
|
||||
empty_command_response!(MixRampDelay);
|
||||
|
||||
impl Command<'_, '_> for MixRampDelay {
|
||||
impl Command for MixRampDelay {
|
||||
type Request = MixRampDelayRequest;
|
||||
type Response = MixRampDelayResponse;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ pub struct Random;
|
||||
|
||||
pub struct RandomRequest(bool);
|
||||
|
||||
impl CommandRequest<'_> for RandomRequest {
|
||||
impl CommandRequest for RandomRequest {
|
||||
const COMMAND: &'static str = "random";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -42,7 +42,7 @@ impl CommandRequest<'_> for RandomRequest {
|
||||
|
||||
empty_command_response!(Random);
|
||||
|
||||
impl Command<'_, '_> for Random {
|
||||
impl Command for Random {
|
||||
type Request = RandomRequest;
|
||||
type Response = RandomResponse;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ pub struct Repeat;
|
||||
|
||||
pub struct RepeatRequest(bool);
|
||||
|
||||
impl CommandRequest<'_> for RepeatRequest {
|
||||
impl CommandRequest for RepeatRequest {
|
||||
const COMMAND: &'static str = "repeat";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -42,7 +42,7 @@ impl CommandRequest<'_> for RepeatRequest {
|
||||
|
||||
empty_command_response!(Repeat);
|
||||
|
||||
impl Command<'_, '_> for Repeat {
|
||||
impl Command for Repeat {
|
||||
type Request = RepeatRequest;
|
||||
type Response = RepeatResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(ReplayGainMode, "replay_gain_mode", ReplayGainModeM
|
||||
|
||||
empty_command_response!(ReplayGainMode);
|
||||
|
||||
impl Command<'_, '_> for ReplayGainMode {
|
||||
impl Command for ReplayGainMode {
|
||||
type Request = ReplayGainModeRequest;
|
||||
type Response = ReplayGainModeResponse;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ pub struct ReplayGainStatusResponse {
|
||||
pub replay_gain_mode: ReplayGainModeMode,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for ReplayGainStatusResponse {
|
||||
impl CommandResponse for ReplayGainStatusResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -41,7 +41,7 @@ impl CommandResponse<'_> for ReplayGainStatusResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for ReplayGainStatus {
|
||||
impl Command for ReplayGainStatus {
|
||||
type Request = ReplayGainStatusRequest;
|
||||
type Response = ReplayGainStatusResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(SetVol, "setvol", VolumeValue);
|
||||
|
||||
empty_command_response!(SetVol);
|
||||
|
||||
impl Command<'_, '_> for SetVol {
|
||||
impl Command for SetVol {
|
||||
type Request = SetVolRequest;
|
||||
type Response = SetVolResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(Single, "single", BoolOrOneshot);
|
||||
|
||||
empty_command_response!(Single);
|
||||
|
||||
impl Command<'_, '_> for Single {
|
||||
impl Command for Single {
|
||||
type Request = SingleRequest;
|
||||
type Response = SingleResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(Volume, "volume", VolumeValue);
|
||||
|
||||
empty_command_response!(Volume);
|
||||
|
||||
impl Command<'_, '_> for Volume {
|
||||
impl Command for Volume {
|
||||
type Request = VolumeRequest;
|
||||
type Response = VolumeResponse;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ empty_command_request!(ClearError, "clearerror");
|
||||
|
||||
empty_command_response!(ClearError);
|
||||
|
||||
impl Command<'_, '_> for ClearError {
|
||||
impl Command for ClearError {
|
||||
type Request = ClearErrorRequest;
|
||||
type Response = ClearErrorResponse;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ pub struct CurrentSongResponse {
|
||||
song_info: DbSongInfo,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for CurrentSongResponse {
|
||||
impl CommandResponse for CurrentSongResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -54,7 +54,7 @@ impl CommandResponse<'_> for CurrentSongResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for CurrentSong {
|
||||
impl Command for CurrentSong {
|
||||
type Request = CurrentSongRequest;
|
||||
type Response = CurrentSongResponse;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ pub struct Idle;
|
||||
|
||||
pub struct IdleRequest(Option<Vec<SubSystem>>);
|
||||
|
||||
impl CommandRequest<'_> for IdleRequest {
|
||||
impl CommandRequest for IdleRequest {
|
||||
const COMMAND: &'static str = "idle";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -56,7 +56,7 @@ impl CommandRequest<'_> for IdleRequest {
|
||||
|
||||
empty_command_response!(Idle);
|
||||
|
||||
impl Command<'_, '_> for Idle {
|
||||
impl Command for Idle {
|
||||
type Request = IdleRequest;
|
||||
type Response = IdleResponse;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ pub struct StatsResponse {
|
||||
pub db_update: Option<u64>,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for StatsResponse {
|
||||
impl CommandResponse for StatsResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -56,7 +56,7 @@ impl CommandResponse<'_> for StatsResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for Stats {
|
||||
impl Command for Stats {
|
||||
type Request = StatsRequest;
|
||||
type Response = StatsResponse;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ pub struct StatusResponse {
|
||||
pub last_loaded_playlist: Option<String>,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for StatusResponse {
|
||||
impl CommandResponse for StatusResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -178,7 +178,7 @@ impl CommandResponse<'_> for StatusResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for Status {
|
||||
impl Command for Status {
|
||||
type Request = StatusRequest;
|
||||
type Response = StatusResponse;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct AddRequest {
|
||||
position: Option<SongPosition>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for AddRequest {
|
||||
impl CommandRequest for AddRequest {
|
||||
const COMMAND: &'static str = "add";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -60,7 +60,7 @@ impl CommandRequest<'_> for AddRequest {
|
||||
|
||||
empty_command_response!(Add);
|
||||
|
||||
impl Command<'_, '_> for Add {
|
||||
impl Command for Add {
|
||||
type Request = AddRequest;
|
||||
type Response = AddResponse;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ pub struct AddIdRequest {
|
||||
pub position: Option<SongPosition>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for AddIdRequest {
|
||||
impl CommandRequest for AddIdRequest {
|
||||
const COMMAND: &'static str = "addid";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -64,7 +64,7 @@ pub struct AddIdResponse {
|
||||
pub id: SongId,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for AddIdResponse {
|
||||
impl CommandResponse for AddIdResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -84,7 +84,7 @@ impl CommandResponse<'_> for AddIdResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for AddId {
|
||||
impl Command for AddId {
|
||||
type Request = AddIdRequest;
|
||||
type Response = AddIdResponse;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ pub struct AddTagIdRequest {
|
||||
pub tag_value: TagValue,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for AddTagIdRequest {
|
||||
impl CommandRequest for AddTagIdRequest {
|
||||
const COMMAND: &'static str = "addtagid";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -71,7 +71,7 @@ impl CommandRequest<'_> for AddTagIdRequest {
|
||||
|
||||
empty_command_response!(AddTagId);
|
||||
|
||||
impl Command<'_, '_> for AddTagId {
|
||||
impl Command for AddTagId {
|
||||
type Request = AddTagIdRequest;
|
||||
type Response = AddTagIdResponse;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ empty_command_request!(Clear, "clear");
|
||||
|
||||
empty_command_response!(Clear);
|
||||
|
||||
impl Command<'_, '_> for Clear {
|
||||
impl Command for Clear {
|
||||
type Request = ClearRequest;
|
||||
type Response = ClearResponse;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct ClearTagIdRequest {
|
||||
pub tag_name: TagName,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for ClearTagIdRequest {
|
||||
impl CommandRequest for ClearTagIdRequest {
|
||||
const COMMAND: &'static str = "cleartagid";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -53,7 +53,7 @@ impl CommandRequest<'_> for ClearTagIdRequest {
|
||||
|
||||
empty_command_response!(ClearTagId);
|
||||
|
||||
impl Command<'_, '_> for ClearTagId {
|
||||
impl Command for ClearTagId {
|
||||
type Request = ClearTagIdRequest;
|
||||
type Response = ClearTagIdResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(Delete, "delete", OneOrRange);
|
||||
|
||||
empty_command_response!(Delete);
|
||||
|
||||
impl Command<'_, '_> for Delete {
|
||||
impl Command for Delete {
|
||||
type Request = DeleteRequest;
|
||||
type Response = DeleteResponse;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ single_item_command_request!(DeleteId, "deleteid", SongId);
|
||||
|
||||
empty_command_response!(DeleteId);
|
||||
|
||||
impl Command<'_, '_> for DeleteId {
|
||||
impl Command for DeleteId {
|
||||
type Request = DeleteIdRequest;
|
||||
type Response = DeleteIdResponse;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct MoveRequest {
|
||||
pub to: AbsouluteRelativeSongPosition,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for MoveRequest {
|
||||
impl CommandRequest for MoveRequest {
|
||||
const COMMAND: &'static str = "move";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -51,7 +51,7 @@ impl CommandRequest<'_> for MoveRequest {
|
||||
|
||||
empty_command_response!(Move);
|
||||
|
||||
impl Command<'_, '_> for Move {
|
||||
impl Command for Move {
|
||||
type Request = MoveRequest;
|
||||
type Response = MoveResponse;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct MoveIdRequest {
|
||||
pub to: AbsouluteRelativeSongPosition,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for MoveIdRequest {
|
||||
impl CommandRequest for MoveIdRequest {
|
||||
const COMMAND: &'static str = "moveid";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -51,7 +51,7 @@ impl CommandRequest<'_> for MoveIdRequest {
|
||||
|
||||
empty_command_response!(MoveId);
|
||||
|
||||
impl Command<'_, '_> for MoveId {
|
||||
impl Command for MoveId {
|
||||
type Request = MoveIdRequest;
|
||||
type Response = MoveIdResponse;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ empty_command_request!(Playlist, "playlist");
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct PlaylistResponse(Vec<Uri>);
|
||||
|
||||
impl CommandResponse<'_> for PlaylistResponse {
|
||||
impl CommandResponse for PlaylistResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -27,7 +27,7 @@ impl CommandResponse<'_> for PlaylistResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for Playlist {
|
||||
impl Command for Playlist {
|
||||
type Request = PlaylistRequest;
|
||||
type Response = PlaylistResponse;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ pub struct PlaylistFindRequest {
|
||||
window: Option<WindowRange>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for PlaylistFindRequest {
|
||||
impl CommandRequest for PlaylistFindRequest {
|
||||
const COMMAND: &'static str = "playlistfind";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -44,7 +44,7 @@ impl CommandRequest<'_> for PlaylistFindRequest {
|
||||
if let Some(window) = &self.window {
|
||||
cmd.push_str(&format!(" window {}", window));
|
||||
}
|
||||
cmd.push_str("\n");
|
||||
cmd.push('\n');
|
||||
cmd
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ pub struct PlaylistFindResponseEntry {
|
||||
pub song_info: DbSongInfo,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for PlaylistFindResponse {
|
||||
impl CommandResponse for PlaylistFindResponse {
|
||||
fn into_response_enum(self) -> Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -111,7 +111,7 @@ impl CommandResponse<'_> for PlaylistFindResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for PlaylistFind {
|
||||
impl Command for PlaylistFind {
|
||||
type Request = PlaylistFindRequest;
|
||||
type Response = PlaylistFindResponse;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ pub struct PlaylistIdResponseEntry {
|
||||
pub song_info: DbSongInfo,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for PlaylistIdResponse {
|
||||
impl CommandResponse for PlaylistIdResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -35,7 +35,7 @@ impl CommandResponse<'_> for PlaylistIdResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for PlaylistId {
|
||||
impl Command for PlaylistId {
|
||||
type Request = PlaylistIdRequest;
|
||||
type Response = PlaylistIdResponse;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, CommandResponse, RequestParserError, ResponseParserError,
|
||||
Command, CommandResponse, ResponseParserError,
|
||||
single_optional_item_command_request,
|
||||
},
|
||||
response_tokenizer::ResponseAttributes,
|
||||
@@ -24,7 +24,7 @@ pub struct PlaylistInfoResponseEntry {
|
||||
pub song_info: DbSongInfo,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for PlaylistInfoResponse {
|
||||
impl CommandResponse for PlaylistInfoResponse {
|
||||
fn into_response_enum(self) -> crate::Response {
|
||||
todo!()
|
||||
}
|
||||
@@ -38,7 +38,7 @@ impl CommandResponse<'_> for PlaylistInfoResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for PlaylistInfo {
|
||||
impl Command for PlaylistInfo {
|
||||
type Request = PlaylistInfoRequest;
|
||||
type Response = PlaylistInfoResponse;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ pub struct PlaylistSearchRequest {
|
||||
window: Option<WindowRange>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for PlaylistSearchRequest {
|
||||
impl CommandRequest for PlaylistSearchRequest {
|
||||
const COMMAND: &'static str = "playlistsearch";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -43,7 +43,7 @@ impl CommandRequest<'_> for PlaylistSearchRequest {
|
||||
if let Some(window) = &self.window {
|
||||
cmd.push_str(&format!(" window {}", window));
|
||||
}
|
||||
cmd.push_str("\n");
|
||||
cmd.push('\n');
|
||||
cmd
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ pub struct PlaylistSearchResponseEntry {
|
||||
pub song_info: DbSongInfo,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for PlaylistSearchResponse {
|
||||
impl CommandResponse for PlaylistSearchResponse {
|
||||
fn from_response_enum(response: crate::Response) -> Option<Self> {
|
||||
todo!()
|
||||
}
|
||||
@@ -110,7 +110,7 @@ impl CommandResponse<'_> for PlaylistSearchResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for PlaylistSearch {
|
||||
impl Command for PlaylistSearch {
|
||||
type Request = PlaylistSearchRequest;
|
||||
type Response = PlaylistSearchResponse;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ pub struct PlChangesRequest {
|
||||
pub window: Option<WindowRange>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for PlChangesRequest {
|
||||
impl CommandRequest for PlChangesRequest {
|
||||
const COMMAND: &'static str = "plchanges";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -69,7 +69,7 @@ pub struct PlChangesResponseEntry {
|
||||
pub song_info: DbSongInfo,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for PlChangesResponse {
|
||||
impl CommandResponse for PlChangesResponse {
|
||||
fn from_response_enum(response: crate::Response) -> Option<Self> {
|
||||
todo!()
|
||||
}
|
||||
@@ -83,7 +83,7 @@ impl CommandResponse<'_> for PlChangesResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for PlChanges {
|
||||
impl Command for PlChanges {
|
||||
type Request = PlChangesRequest;
|
||||
type Response = PlChangesResponse;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ pub struct PlChangesPosIdRequest {
|
||||
pub window: Option<WindowRange>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for PlChangesPosIdRequest {
|
||||
impl CommandRequest for PlChangesPosIdRequest {
|
||||
const COMMAND: &'static str = "plchangesposid";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -68,7 +68,7 @@ pub struct PlChangesPosIdResponseEntry {
|
||||
pub id: SongId,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for PlChangesPosIdResponse {
|
||||
impl CommandResponse for PlChangesPosIdResponse {
|
||||
fn from_response_enum(response: crate::Response) -> Option<Self> {
|
||||
todo!()
|
||||
}
|
||||
@@ -82,7 +82,7 @@ impl CommandResponse<'_> for PlChangesPosIdResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl Command<'_, '_> for PlChangesPosId {
|
||||
impl Command for PlChangesPosId {
|
||||
type Request = PlChangesPosIdRequest;
|
||||
type Response = PlChangesPosIdResponse;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct PrioRequest {
|
||||
pub window: WindowRange,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for PrioRequest {
|
||||
impl CommandRequest for PrioRequest {
|
||||
const COMMAND: &'static str = "prio";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -51,7 +51,7 @@ impl CommandRequest<'_> for PrioRequest {
|
||||
|
||||
empty_command_response!(Prio);
|
||||
|
||||
impl Command<'_, '_> for Prio {
|
||||
impl Command for Prio {
|
||||
type Request = PrioRequest;
|
||||
type Response = PrioResponse;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct PrioIdRequest {
|
||||
pub songids: Vec<SongId>,
|
||||
}
|
||||
|
||||
impl CommandRequest<'_> for PrioIdRequest {
|
||||
impl CommandRequest for PrioIdRequest {
|
||||
const COMMAND: &'static str = "prioid";
|
||||
|
||||
fn into_request_enum(self) -> crate::Request {
|
||||
@@ -61,7 +61,7 @@ impl CommandRequest<'_> for PrioIdRequest {
|
||||
|
||||
empty_command_response!(PrioId);
|
||||
|
||||
impl Command<'_, '_> for PrioId {
|
||||
impl Command for PrioId {
|
||||
type Request = PrioIdRequest;
|
||||
type Response = PrioIdResponse;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user