2 Commits

Author SHA1 Message Date
291aa6877c WIP 2025-12-08 18:43:44 +09:00
c48a8adcdc .gitea/workflows: run on debian-latest-slim
Some checks failed
Build and test / build (push) Failing after 19s
Build and test / check (push) Failing after 19s
Build and test / test (push) Failing after 23s
Build and test / docs (push) Failing after 15s
2025-12-08 18:43:29 +09:00
11 changed files with 99 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ on:
jobs:
build:
runs-on: debian-latest
runs-on: debian-latest-slim
steps:
- uses: actions/checkout@v6
@@ -18,7 +18,7 @@ jobs:
run: cargo build --verbose --release
check:
runs-on: debian-latest
runs-on: debian-latest-slim
steps:
- uses: actions/checkout@v6
@@ -35,7 +35,7 @@ jobs:
run: cargo clippy
test:
runs-on: debian-latest
runs-on: debian-latest-slim
steps:
- uses: actions/checkout@v6
- uses: cargo-bins/cargo-binstall@main
@@ -88,7 +88,7 @@ jobs:
known-hosts: "pages.pvv.ntnu.no ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2QjfFB+city1SYqltkVqWACfo1j37k+oQQfj13mtgg"
docs:
runs-on: debian-latest
runs-on: debian-latest-slim
steps:
- uses: actions/checkout@v6
@@ -102,7 +102,7 @@ jobs:
run: cargo doc --document-private-items --release
- name: Transfer files
uses: https://git.pvv.ntnu.no/Projects/rsync-action@v2
uses: https://git.pvv.ntnu.no/Projects/rsync-action@v1
with:
source: target/doc/
target: ${{ gitea.ref_name }}/docs/

12
flake.lock generated
View File

@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1765472234,
"narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=",
"lastModified": 1764950072,
"narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b",
"rev": "f61125a668a320878494449750330ca58b78c557",
"type": "github"
},
"original": {
@@ -29,11 +29,11 @@
]
},
"locked": {
"lastModified": 1765680428,
"narHash": "sha256-fyPmRof9SZeI14ChPk5rVPOm7ISiiGkwGCunkhM+eUg=",
"lastModified": 1765075567,
"narHash": "sha256-KFDCdQcHJ0hE3Nt5Gm5enRIhmtEifAjpxgUQ3mzSJpA=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "eb3898d8ef143d4bf0f7f2229105fc51c7731b2f",
"rev": "769156779b41e8787a46ca3d7d76443aaf68be6f",
"type": "github"
},
"original": {

View File

@@ -272,6 +272,12 @@ macro_rules! empty_command_request {
pub struct [<$name Request>];
}
impl paste::paste! { [<$name Request>] } {
pub fn new() -> Self {
Self
}
}
impl crate::commands::CommandRequest for paste::paste! { [<$name Request>] } {
const COMMAND: &'static str = $command_name;
const MIN_ARGS: u32 = 0;
@@ -315,6 +321,12 @@ macro_rules! empty_command_response {
pub struct [<$name Response>];
}
impl paste::paste! { [<$name Response>] } {
pub fn new() -> Self {
Self
}
}
impl crate::commands::CommandResponse for paste::paste! { [<$name Response>] } {
fn into_response_enum(self) -> crate::Response {
todo!()
@@ -341,6 +353,12 @@ macro_rules! single_item_command_request {
pub struct [<$name Request>] ($item_type);
}
impl paste::paste! { [<$name Request>] } {
pub fn new(arg: $item_type) -> Self {
Self(arg)
}
}
impl crate::commands::CommandRequest for paste::paste! { [<$name Request>] } {
const COMMAND: &'static str = $command_name;
const MIN_ARGS: u32 = 1;
@@ -394,6 +412,12 @@ macro_rules! single_optional_item_command_request {
pub struct [<$name Request>] (Option<$item_type>);
}
impl paste::paste! { [<$name Request>] } {
pub fn new(arg: Option<$item_type>) -> Self {
Self(arg)
}
}
impl crate::commands::CommandRequest for paste::paste! { [<$name Request>] } {
const COMMAND: &'static str = $command_name;
const MIN_ARGS: u32 = 0;
@@ -453,6 +477,12 @@ macro_rules! single_item_command_response {
pub struct [<$name Response>] ( $item_type );
}
impl paste::paste! { [<$name Response>] } {
pub fn new(arg: $item_type) -> Self {
Self(arg)
}
}
impl crate::commands::CommandResponse for paste::paste! { [<$name Response>] } {
fn into_response_enum(self) -> crate::Response {
todo!()
@@ -497,6 +527,12 @@ macro_rules! multi_item_command_response {
pub struct [<$name Response>] ( Vec<$item_type> );
}
impl paste::paste! { [<$name Response>] } {
pub fn new(arg: Vec<$item_type>) -> Self {
Self(arg)
}
}
impl crate::commands::CommandResponse for paste::paste! { [<$name Response>] } {
fn into_response_enum(self) -> crate::Response {
todo!()

View File

@@ -15,6 +15,16 @@ pub struct OutputSetRequest {
pub attribute_value: String,
}
impl OutputSetRequest {
fn new(output_id: AudioOutputId, attribute_name: String, attribute_value: String) -> Self {
Self {
output_id,
attribute_name,
attribute_value,
}
}
}
impl CommandRequest for OutputSetRequest {
const COMMAND: &'static str = "outputset";
const MIN_ARGS: u32 = 3;

View File

@@ -14,6 +14,12 @@ pub struct SendMessageRequest {
pub message: String,
}
impl SendMessageRequest {
fn new(channel: ChannelName, message: String) -> Self {
Self { channel, message }
}
}
impl CommandRequest for SendMessageRequest {
const COMMAND: &'static str = "sendmessage";
const MIN_ARGS: u32 = 2;

View File

@@ -8,6 +8,12 @@ pub struct ProtocolDisable;
pub struct ProtocolDisableRequest(Vec<Feature>);
impl ProtocolDisableRequest {
fn new(features: Vec<Feature>) -> Self {
Self(features)
}
}
impl CommandRequest for ProtocolDisableRequest {
const COMMAND: &'static str = "protocol disable";
const MIN_ARGS: u32 = 1;

View File

@@ -8,6 +8,12 @@ pub struct ProtocolEnable;
pub struct ProtocolEnableRequest(Vec<Feature>);
impl ProtocolEnableRequest {
fn new(features: Vec<Feature>) -> Self {
Self(features)
}
}
impl CommandRequest for ProtocolEnableRequest {
const COMMAND: &'static str = "protocol enable";
const MIN_ARGS: u32 = 1;

View File

@@ -10,6 +10,12 @@ pub struct TagTypesDisable;
pub struct TagTypesDisableRequest(Vec<TagName>);
impl TagTypesDisableRequest {
fn new(tagnames: Vec<TagName>) -> Self {
Self(tagnames)
}
}
impl CommandRequest for TagTypesDisableRequest {
const COMMAND: &'static str = "tagtypes disable";
const MIN_ARGS: u32 = 1;

View File

@@ -8,6 +8,12 @@ pub struct TagTypesEnable;
pub struct TagTypesEnableRequest(Vec<TagName>);
impl TagTypesEnableRequest {
fn new(tagnames: Vec<TagName>) -> Self {
Self(tagnames)
}
}
impl CommandRequest for TagTypesEnableRequest {
const COMMAND: &'static str = "tagtypes enable";
const MIN_ARGS: u32 = 1;

View File

@@ -8,6 +8,12 @@ pub struct TagTypesReset;
pub struct TagTypesResetRequest(Vec<TagName>);
impl TagTypesResetRequest {
fn new(tagnames: Vec<TagName>) -> Self {
Self(tagnames)
}
}
impl CommandRequest for TagTypesResetRequest {
const COMMAND: &'static str = "tagtypes reset";
const MIN_ARGS: u32 = 1;

View File

@@ -7,6 +7,12 @@ pub struct Pause;
pub struct PauseRequest(Option<bool>);
impl PauseRequest {
fn new(toggle: Option<bool>) -> Self {
Self(toggle)
}
}
impl CommandRequest for PauseRequest {
const COMMAND: &'static str = "pause";
const MIN_ARGS: u32 = 0;