9 Commits

Author SHA1 Message Date
088665c9ff flake.lock: bump
Some checks failed
Build and test / build (push) Successful in 45s
Build and test / check (push) Failing after 46s
Build and test / test (push) Successful in 1m11s
Build and test / docs (push) Successful in 1m37s
2025-08-03 05:01:37 +02:00
3e2e3fdc68 .gitea/workflows: update gitea-web target host
Some checks failed
Build and test / build (push) Failing after 1m17s
Build and test / check (push) Failing after 1m18s
Build and test / docs (push) Failing after 1m26s
Build and test / test (push) Successful in 1m31s
2025-08-03 04:50:54 +02:00
59994ce740 Cargo.toml: update deps
Some checks failed
Build and test / build (push) Successful in 1m29s
Build and test / check (push) Failing after 1m37s
Build and test / docs (push) Failing after 2m1s
Build and test / test (push) Failing after 2m29s
2025-07-11 20:37:16 +02:00
b42cad0b52 flake.lock: bump 2025-07-11 20:36:58 +02:00
3c49ece1a9 flake.nix: add cargo-edit to devshell 2025-07-11 20:36:50 +02:00
5a5870d7de flake.lock: bump
Some checks failed
Build and test / build (push) Has been cancelled
Build and test / check (push) Has been cancelled
Build and test / test (push) Has been cancelled
Build and test / docs (push) Has been cancelled
2025-05-07 10:43:24 +02:00
e5303954c5 Cargo.lock: bump
Some checks failed
Build and test / check (push) Has been cancelled
Build and test / build (push) Has been cancelled
Build and test / test (push) Has been cancelled
Build and test / docs (push) Has been cancelled
2025-05-05 10:15:00 +02:00
c95d39a9ec flake.lock: bump
Some checks failed
Build and test / build (push) Has been cancelled
Build and test / check (push) Has been cancelled
Build and test / test (push) Has been cancelled
Build and test / docs (push) Has been cancelled
2025-05-05 10:13:44 +02:00
e910d29aa4 Rust edition 2024
Some checks failed
Build and test / build (push) Successful in 59s
Build and test / check (push) Failing after 1m2s
Build and test / test (push) Successful in 1m42s
Build and test / docs (push) Successful in 1m19s
2025-02-26 16:39:34 +01:00
70 changed files with 119 additions and 137 deletions

View File

@@ -83,8 +83,8 @@ jobs:
target: ${{ gitea.ref_name }}/coverage/ target: ${{ gitea.ref_name }}/coverage/
username: gitea-web username: gitea-web
ssh-key: ${{ secrets.WEB_SYNC_SSH_KEY }} ssh-key: ${{ secrets.WEB_SYNC_SSH_KEY }}
host: bekkalokk.pvv.ntnu.no host: pages.pvv.ntnu.no
known-hosts: "bekkalokk.pvv.ntnu.no ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEI6VSaDrMG8+flg4/AeHlAFIen8RUzWh6URQKqFegSx" known-hosts: "pages.pvv.ntnu.no ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2QjfFB+city1SYqltkVqWACfo1j37k+oQQfj13mtgg"
docs: docs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -107,6 +107,6 @@ jobs:
target: ${{ gitea.ref_name }}/docs/ target: ${{ gitea.ref_name }}/docs/
username: gitea-web username: gitea-web
ssh-key: ${{ secrets.WEB_SYNC_SSH_KEY }} ssh-key: ${{ secrets.WEB_SYNC_SSH_KEY }}
host: bekkalokk.pvv.ntnu.no host: pages.pvv.ntnu.no
known-hosts: "bekkalokk.pvv.ntnu.no ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEI6VSaDrMG8+flg4/AeHlAFIen8RUzWh6URQKqFegSx" known-hosts: "pages.pvv.ntnu.no ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2QjfFB+city1SYqltkVqWACfo1j37k+oQQfj13mtgg"

30
Cargo.lock generated
View File

@@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo. # This file is automatically @generated by Cargo.
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 4
[[package]] [[package]]
name = "diff" name = "diff"
@@ -19,9 +19,9 @@ dependencies = [
[[package]] [[package]]
name = "indoc" name = "indoc"
version = "2.0.5" version = "2.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd"
[[package]] [[package]]
name = "pretty_assertions" name = "pretty_assertions"
@@ -35,36 +35,36 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.88" version = "1.0.95"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.37" version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.210" version = "1.0.219"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.210" version = "1.0.219"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -73,9 +73,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.82" version = "2.0.104"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -84,9 +84,9 @@ dependencies = [
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.13" version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
[[package]] [[package]]
name = "yansi" name = "yansi"

View File

@@ -7,12 +7,12 @@ authors = [
description = "A rust implementation of the mpd protocol, both client and serverside" description = "A rust implementation of the mpd protocol, both client and serverside"
repository = "https://git.pvv.ntnu.no/Grzegorz/empidee" repository = "https://git.pvv.ntnu.no/Grzegorz/empidee"
documentation = "https://pages.pvv.ntnu.no/Grzegorz/empidee/main/docs/empidee/" documentation = "https://pages.pvv.ntnu.no/Grzegorz/empidee/main/docs/empidee/"
edition = "2021" edition = "2024"
rust-version = "1.83.0" rust-version = "1.85.0"
[dependencies] [dependencies]
serde = { version = "1.0.210", features = ["derive"] } serde = { version = "1.0.219", features = ["derive"] }
[dev-dependencies] [dev-dependencies]
indoc = "2.0.5" indoc = "2.0.6"
pretty_assertions = "1.4.1" pretty_assertions = "1.4.1"

12
flake.lock generated
View File

@@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1739866667, "lastModified": 1753939845,
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=", "narHash": "sha256-K2ViRJfdVGE8tpJejs8Qpvvejks1+A4GQej/lBk5y7I=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680", "rev": "94def634a20494ee057c76998843c015909d6311",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -29,11 +29,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1740277845, "lastModified": 1754189623,
"narHash": "sha256-NNU0CdiaSbAeZ8tpDG4aFi9qtcdlItRvk8Xns9oBrVU=", "narHash": "sha256-fstu5eb30UYwsxow0aQqkzxNxGn80UZjyehQVNVHuBk=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "f933070c29f9c1c5457447a51903f27f76ebb519", "rev": "c582ff7f0d8a7ea689ae836dfb1773f1814f472a",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -36,6 +36,7 @@
default = pkgs.mkShell { default = pkgs.mkShell {
nativeBuildInputs = [ nativeBuildInputs = [
toolchain toolchain
pkgs.cargo-edit
]; ];
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library"; RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";

1
rustfmt.toml Normal file
View File

@@ -0,0 +1 @@
style_edition = "2024"

View File

@@ -1,8 +1,8 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::commands::{ use crate::commands::{
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, expect_property_type,
}; };
pub struct Channels; pub struct Channels;

View File

@@ -1,8 +1,8 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::commands::{ use crate::commands::{
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, expect_property_type,
}; };
pub struct ReadMessages; pub struct ReadMessages;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct Protocol; pub struct Protocol;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct ProtocolAll; pub struct ProtocolAll;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct ProtocolAvailable; pub struct ProtocolAvailable;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct ProtocolClear; pub struct ProtocolClear;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct ProtocolDisable; pub struct ProtocolDisable;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct ProtocolEnable; pub struct ProtocolEnable;

View File

@@ -30,7 +30,7 @@ impl Command for TagTypes {
GenericResponseValue::Binary(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType( return Err(ResponseParserError::UnexpectedPropertyType(
"tagtype", "Binary", "tagtype", "Binary",
)) ));
} }
}; };

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct TagTypesAll; pub struct TagTypesAll;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct TagTypesAvailable; pub struct TagTypesAvailable;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct TagTypesClear; pub struct TagTypesClear;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct TagTypesDisable; pub struct TagTypesDisable;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct TagTypesEnable; pub struct TagTypesEnable;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct TagTypesReset; pub struct TagTypesReset;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct ListMounts; pub struct ListMounts;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct ListNeighbors; pub struct ListNeighbors;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct Mount; pub struct Mount;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct Unmount; pub struct Unmount;

View File

@@ -2,8 +2,8 @@ use std::collections::HashMap;
use crate::{ use crate::{
commands::{ commands::{
get_and_parse_property, get_property, Command, Request, RequestParserError, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
RequestParserResult, ResponseAttributes, ResponseParserError, ResponseParserError, get_and_parse_property, get_property,
}, },
common::Offset, common::Offset,
}; };

View File

@@ -2,8 +2,8 @@ use std::collections::HashMap;
use crate::{ use crate::{
commands::{ commands::{
get_and_parse_property, Command, Request, RequestParserError, RequestParserResult, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
ResponseAttributes, ResponseParserError, ResponseParserError, get_and_parse_property,
}, },
filter::parse_filter, filter::parse_filter,
}; };

View File

@@ -1,8 +1,8 @@
use std::collections::HashMap; use std::collections::HashMap;
use crate::commands::{ use crate::commands::{
get_and_parse_property, Command, Request, RequestParserError, RequestParserResult, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
ResponseAttributes, ResponseParserError, ResponseParserError, get_and_parse_property,
}; };
pub struct GetFingerprint; pub struct GetFingerprint;

View File

@@ -1,7 +1,7 @@
use crate::{ use crate::{
commands::{ commands::{
expect_property_type, Command, Request, RequestParserError, RequestParserResult, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
ResponseAttributes, ResponseParserError, ResponseParserError, expect_property_type,
}, },
filter::parse_filter, filter::parse_filter,
}; };

View File

@@ -2,8 +2,8 @@ use std::collections::HashMap;
use crate::{ use crate::{
commands::{ commands::{
get_and_parse_property, get_optional_property, get_property, Command, Request, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, ResponseParserError, get_and_parse_property, get_optional_property, get_property,
}, },
common::Offset, common::Offset,
}; };

View File

@@ -1,8 +1,8 @@
use std::collections::HashMap; use std::collections::HashMap;
use crate::commands::{ use crate::commands::{
get_and_parse_property, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, get_and_parse_property,
}; };
pub struct Rescan; pub struct Rescan;

View File

@@ -2,8 +2,8 @@ use std::collections::HashMap;
use crate::{ use crate::{
commands::{ commands::{
get_and_parse_property, Command, Request, RequestParserError, RequestParserResult, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
ResponseAttributes, ResponseParserError, ResponseParserError, get_and_parse_property,
}, },
filter::parse_filter, filter::parse_filter,
}; };

View File

@@ -1,8 +1,8 @@
use std::collections::HashMap; use std::collections::HashMap;
use crate::commands::{ use crate::commands::{
get_and_parse_property, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, get_and_parse_property,
}; };
pub struct Update; pub struct Update;

View File

@@ -1,6 +1,6 @@
use crate::commands::{ use crate::commands::{
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, expect_property_type,
}; };
pub struct ListPartitions; pub struct ListPartitions;

View File

@@ -2,8 +2,8 @@ use std::collections::HashMap;
use crate::{ use crate::{
commands::{ commands::{
get_and_parse_property, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, get_and_parse_property,
}, },
common::VolumeValue, common::VolumeValue,
}; };

View File

@@ -4,8 +4,8 @@ use serde::{Deserialize, Serialize};
use crate::{ use crate::{
commands::{ commands::{
get_property, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, get_property,
}, },
common::ReplayGainModeMode, common::ReplayGainModeMode,
}; };

View File

@@ -3,8 +3,8 @@ use std::collections::HashMap;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::commands::{ use crate::commands::{
get_and_parse_optional_property, get_and_parse_property, Command, Request, RequestParserResult, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseAttributes, ResponseParserError, get_and_parse_optional_property, get_and_parse_property,
}; };
pub struct Stats; pub struct Stats;

View File

@@ -6,9 +6,9 @@ use serde::{Deserialize, Serialize};
use crate::common::{Audio, BoolOrOneshot, SongId, SongPosition}; use crate::common::{Audio, BoolOrOneshot, SongId, SongPosition};
use crate::commands::{ use crate::commands::{
get_and_parse_optional_property, get_and_parse_property, get_optional_property, get_property,
Command, GenericResponseValue, Request, RequestParserResult, ResponseAttributes, Command, GenericResponseValue, Request, RequestParserResult, ResponseAttributes,
ResponseParserError, ResponseParserError, get_and_parse_optional_property, get_and_parse_property,
get_optional_property, get_property,
}; };
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]

View File

@@ -1,7 +1,7 @@
use crate::{ use crate::{
commands::{ commands::{
get_next_and_parse_property, Command, Request, RequestParserError, RequestParserResult, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
ResponseAttributes, ResponseParserError, ResponseParserError, get_next_and_parse_property,
}, },
common::{SongId, SongPosition}, common::{SongId, SongPosition},
}; };

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct AddTagId; pub struct AddTagId;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct ClearTagId; pub struct ClearTagId;

View File

@@ -1,11 +1,11 @@
use std::str::FromStr; use std::str::FromStr;
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
common::OneOrRange, common::OneOrRange,
Request,
}; };
pub struct Delete; pub struct Delete;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct DeleteId; pub struct DeleteId;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct Move; pub struct Move;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct MoveId; pub struct MoveId;

View File

@@ -1,14 +1,12 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct Playlist; pub struct Playlist;
pub type PlaylistResponse = Vec<String>;
impl Command for Playlist { impl Command for Playlist {
type Response = PlaylistResponse; type Response = ();
const COMMAND: &'static str = "playlist"; const COMMAND: &'static str = "playlist";
fn parse_request(mut parts: std::str::SplitWhitespace<'_>) -> RequestParserResult<'_> { fn parse_request(mut parts: std::str::SplitWhitespace<'_>) -> RequestParserResult<'_> {
@@ -19,7 +17,6 @@ impl Command for Playlist {
fn parse_response( fn parse_response(
_parts: ResponseAttributes<'_>, _parts: ResponseAttributes<'_>,
) -> Result<Self::Response, ResponseParserError> { ) -> Result<Self::Response, ResponseParserError> {
// TODO: 1: https, 2: https, etc.
unimplemented!() unimplemented!()
} }
} }

View File

@@ -1,9 +1,9 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
filter::parse_filter, filter::parse_filter,
Request,
}; };
pub struct PlaylistFind; pub struct PlaylistFind;
@@ -44,9 +44,6 @@ impl Command for PlaylistFind {
fn parse_response( fn parse_response(
_parts: ResponseAttributes<'_>, _parts: ResponseAttributes<'_>,
) -> Result<Self::Response, ResponseParserError> { ) -> Result<Self::Response, ResponseParserError> {
// Pos:
// Id:
// (Prio:)
unimplemented!() unimplemented!()
} }
} }

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct PlaylistId; pub struct PlaylistId;
@@ -25,9 +25,6 @@ impl Command for PlaylistId {
fn parse_response( fn parse_response(
_parts: ResponseAttributes<'_>, _parts: ResponseAttributes<'_>,
) -> Result<Self::Response, ResponseParserError> { ) -> Result<Self::Response, ResponseParserError> {
// Pos:
// Id:
// (Prio:)
unimplemented!() unimplemented!()
} }
} }

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct PlaylistInfo; pub struct PlaylistInfo;
@@ -28,9 +28,6 @@ impl Command for PlaylistInfo {
fn parse_response( fn parse_response(
_parts: ResponseAttributes<'_>, _parts: ResponseAttributes<'_>,
) -> Result<Self::Response, ResponseParserError> { ) -> Result<Self::Response, ResponseParserError> {
// Pos:
// Id:
// (Prio:)
unimplemented!() unimplemented!()
} }
} }

View File

@@ -1,9 +1,9 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
filter::parse_filter, filter::parse_filter,
Request,
}; };
pub struct PlaylistSearch; pub struct PlaylistSearch;
@@ -44,9 +44,6 @@ impl Command for PlaylistSearch {
fn parse_response( fn parse_response(
_parts: ResponseAttributes<'_>, _parts: ResponseAttributes<'_>,
) -> Result<Self::Response, ResponseParserError> { ) -> Result<Self::Response, ResponseParserError> {
// Pos:
// Id:
// (Prio:)
unimplemented!() unimplemented!()
} }
} }

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct PlChanges; pub struct PlChanges;
@@ -33,9 +33,6 @@ impl Command for PlChanges {
fn parse_response( fn parse_response(
parts: ResponseAttributes<'_>, parts: ResponseAttributes<'_>,
) -> Result<Self::Response, ResponseParserError> { ) -> Result<Self::Response, ResponseParserError> {
// Pos:
// Id:
// (Prio:)
unimplemented!() unimplemented!()
} }
} }

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct PlChangesPosId; pub struct PlChangesPosId;
@@ -33,8 +33,6 @@ impl Command for PlChangesPosId {
fn parse_response( fn parse_response(
parts: ResponseAttributes<'_>, parts: ResponseAttributes<'_>,
) -> Result<Self::Response, ResponseParserError> { ) -> Result<Self::Response, ResponseParserError> {
// cpos:
// Id:
unimplemented!() unimplemented!()
} }
} }

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct Prio; pub struct Prio;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct PrioId; pub struct PrioId;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct RangeId; pub struct RangeId;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct Shuffle; pub struct Shuffle;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct Swap; pub struct Swap;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct SwapId; pub struct SwapId;

View File

@@ -30,7 +30,7 @@ impl Command for Commands {
GenericResponseValue::Binary(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType( return Err(ResponseParserError::UnexpectedPropertyType(
"handler", "Binary", "handler", "Binary",
)) ));
} }
}; };
result.push(value.to_string()); result.push(value.to_string());

View File

@@ -1,8 +1,8 @@
use std::collections::HashMap; use std::collections::HashMap;
use crate::commands::{ use crate::commands::{
get_and_parse_property, get_property, Command, Request, RequestParserResult, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseAttributes, ResponseParserError, get_and_parse_property, get_property,
}; };
pub struct Config; pub struct Config;

View File

@@ -30,7 +30,7 @@ impl Command for NotCommands {
GenericResponseValue::Binary(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType( return Err(ResponseParserError::UnexpectedPropertyType(
"handler", "Binary", "handler", "Binary",
)) ));
} }
}; };
result.push(value.to_string()); result.push(value.to_string());

View File

@@ -30,7 +30,7 @@ impl Command for UrlHandlers {
GenericResponseValue::Binary(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType( return Err(ResponseParserError::UnexpectedPropertyType(
"handler", "Binary", "handler", "Binary",
)) ));
} }
}; };
url_handlers.push(value.to_string()); url_handlers.push(value.to_string());

View File

@@ -87,7 +87,7 @@ impl Command for StickerFind {
let uri = match uri.1 { let uri = match uri.1 {
GenericResponseValue::Text(s) => s.to_string(), GenericResponseValue::Text(s) => s.to_string(),
GenericResponseValue::Binary(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType(uri.0, "Binary")) return Err(ResponseParserError::UnexpectedPropertyType(uri.0, "Binary"));
} }
}; };
@@ -96,7 +96,7 @@ impl Command for StickerFind {
GenericResponseValue::Binary(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType( return Err(ResponseParserError::UnexpectedPropertyType(
"sticker", "Binary", "sticker", "Binary",
)) ));
} }
}; };

View File

@@ -1,6 +1,6 @@
use crate::commands::{ use crate::commands::{
get_next_property, Command, Request, RequestParserError, RequestParserResult, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
ResponseAttributes, ResponseParserError, ResponseParserError, get_next_property,
}; };
pub struct StickerGet; pub struct StickerGet;

View File

@@ -1,6 +1,6 @@
use crate::commands::{ use crate::commands::{
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, expect_property_type,
}; };
pub struct StickerNames; pub struct StickerNames;

View File

@@ -39,7 +39,7 @@ impl Command for StickerNamesTypes {
GenericResponseValue::Binary(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType( return Err(ResponseParserError::UnexpectedPropertyType(
"name", "Binary", "name", "Binary",
)) ));
} }
}; };
@@ -48,7 +48,7 @@ impl Command for StickerNamesTypes {
GenericResponseValue::Binary(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType( return Err(ResponseParserError::UnexpectedPropertyType(
"type", "Binary", "type", "Binary",
)) ));
} }
}; };

View File

@@ -1,6 +1,6 @@
use crate::commands::{ use crate::commands::{
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, expect_property_type,
}; };
pub struct StickerTypes; pub struct StickerTypes;

View File

@@ -1,8 +1,8 @@
use std::collections::HashMap; use std::collections::HashMap;
use crate::commands::{ use crate::commands::{
get_and_parse_property, Command, Request, RequestParserError, RequestParserResult, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
ResponseAttributes, ResponseParserError, ResponseParserError, get_and_parse_property,
}; };
pub struct PlaylistLength; pub struct PlaylistLength;

View File

@@ -239,7 +239,7 @@ impl Request {
.ok_or(RequestParserError::MissingCommandListEnd(i))?; .ok_or(RequestParserError::MissingCommandListEnd(i))?;
match line.trim() { match line.trim() {
"command_list_begin" => { "command_list_begin" => {
return Err(RequestParserError::NestedCommandList(i)) return Err(RequestParserError::NestedCommandList(i));
} }
"command_list_end" => { "command_list_end" => {
return Ok((Request::CommandList(commands), rest)); return Ok((Request::CommandList(commands), rest));

View File

@@ -1,4 +1,4 @@
use crate::{common::SubSystem, Request, Response}; use crate::{Request, Response, common::SubSystem};
pub trait MPDServer { pub trait MPDServer {
type Error; type Error;