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
10 changed files with 92 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: debian-latest-slim
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
@@ -18,7 +18,7 @@ jobs:
run: cargo build --verbose --release run: cargo build --verbose --release
check: check:
runs-on: ubuntu-latest runs-on: debian-latest-slim
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
@@ -35,7 +35,7 @@ jobs:
run: cargo clippy run: cargo clippy
test: test:
runs-on: ubuntu-latest runs-on: debian-latest-slim
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- uses: cargo-bins/cargo-binstall@main - uses: cargo-bins/cargo-binstall@main
@@ -88,7 +88,7 @@ jobs:
known-hosts: "pages.pvv.ntnu.no ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2QjfFB+city1SYqltkVqWACfo1j37k+oQQfj13mtgg" known-hosts: "pages.pvv.ntnu.no ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2QjfFB+city1SYqltkVqWACfo1j37k+oQQfj13mtgg"
docs: docs:
runs-on: ubuntu-latest runs-on: debian-latest-slim
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6

View File

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

View File

@@ -15,6 +15,16 @@ pub struct OutputSetRequest {
pub attribute_value: String, 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 { impl CommandRequest for OutputSetRequest {
const COMMAND: &'static str = "outputset"; const COMMAND: &'static str = "outputset";
const MIN_ARGS: u32 = 3; const MIN_ARGS: u32 = 3;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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