mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-06-14 19:51:58 +08:00
feat: 初步增加 Windows 支持
This commit is contained in:
34
src/atx/disabled_key.rs
Normal file
34
src/atx/disabled_key.rs
Normal file
@@ -0,0 +1,34 @@
|
||||
use async_trait::async_trait;
|
||||
use std::time::Duration;
|
||||
|
||||
use super::traits::AtxKeyBackend;
|
||||
use crate::error::{AppError, Result};
|
||||
|
||||
pub struct DisabledAtxKeyBackend {
|
||||
reason: &'static str,
|
||||
}
|
||||
|
||||
impl DisabledAtxKeyBackend {
|
||||
pub fn new(reason: &'static str) -> Self {
|
||||
Self { reason }
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl AtxKeyBackend for DisabledAtxKeyBackend {
|
||||
async fn init(&mut self) -> Result<()> {
|
||||
Err(AppError::Internal(self.reason.to_string()))
|
||||
}
|
||||
|
||||
async fn pulse(&self, _duration: Duration) -> Result<()> {
|
||||
Err(AppError::Internal(self.reason.to_string()))
|
||||
}
|
||||
|
||||
async fn shutdown(&mut self) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn is_initialized(&self) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user