mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Remove typeshare use
This commit is contained in:
@@ -23,6 +23,5 @@ dmi_id = { path = "../dmi-id" }
|
||||
|
||||
# cli and logging
|
||||
log.workspace = true
|
||||
typeshare.workspace = true
|
||||
|
||||
ron = { version = "*", optional = true }
|
||||
|
||||
@@ -2,14 +2,12 @@ use std::fmt::Display;
|
||||
use std::str::FromStr;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
#[cfg(feature = "dbus")]
|
||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||
|
||||
use crate::error::Error;
|
||||
use crate::AURA_LAPTOP_LED_MSG_LEN;
|
||||
|
||||
#[typeshare]
|
||||
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
@@ -79,7 +77,6 @@ impl From<i32> for LedBrightness {
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Copy, Deserialize, Serialize)]
|
||||
pub struct Colour {
|
||||
@@ -140,7 +137,6 @@ impl From<Colour> for [u8; 3] {
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
derive(Type, Value, OwnedValue),
|
||||
@@ -200,7 +196,6 @@ impl From<Speed> for u8 {
|
||||
/// Used for Rainbow mode.
|
||||
///
|
||||
/// Enum corresponds to the required integer value
|
||||
#[typeshare]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
derive(Type, Value, OwnedValue),
|
||||
@@ -248,7 +243,6 @@ impl From<Direction> for i32 {
|
||||
}
|
||||
|
||||
/// Enum of modes that convert to the actual number required by a USB HID packet
|
||||
#[typeshare]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
derive(Type, Value, OwnedValue),
|
||||
@@ -360,7 +354,6 @@ impl From<AuraEffect> for AuraModeNum {
|
||||
}
|
||||
|
||||
/// Base effects have no zoning, while multizone is 1-4
|
||||
#[typeshare]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
derive(Type, Value, OwnedValue),
|
||||
@@ -432,7 +425,6 @@ impl From<AuraZone> for i32 {
|
||||
/// ```rust
|
||||
/// // let bytes: [u8; LED_MSG_LEN] = mode.into();
|
||||
/// ```
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
||||
pub struct AuraEffect {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use log::warn;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
#[cfg(feature = "dbus")]
|
||||
use zbus::zvariant::Type;
|
||||
|
||||
@@ -194,7 +193,6 @@ impl LedCode {
|
||||
}
|
||||
|
||||
/// Represents the per-key raw USB packets
|
||||
#[typeshare]
|
||||
pub type AuraLaptopUsbPackets = Vec<Vec<u8>>;
|
||||
|
||||
/// A `UsbPackets` contains all data to change the full set of keyboard
|
||||
@@ -204,7 +202,6 @@ pub type AuraLaptopUsbPackets = Vec<Vec<u8>>;
|
||||
/// to the keyboard EC. One row controls one group of keys, these keys are not
|
||||
/// necessarily all on the same row of the keyboard, with some splitting between
|
||||
/// two rows.
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type))]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct LedUsbPackets {
|
||||
|
||||
@@ -5,7 +5,6 @@ use std::ops::{BitAnd, BitOr};
|
||||
|
||||
use log::warn;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
#[cfg(feature = "dbus")]
|
||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||
|
||||
@@ -16,7 +15,6 @@ use crate::{AuraDeviceType, PowerZones};
|
||||
/// - 2021+, the struct is a single zone with 4 states
|
||||
/// - pre-2021, the struct is 1 or 2 zones and 3 states
|
||||
/// - Tuf, the struct is 1 zone and 3 states
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct AuraPowerState {
|
||||
@@ -145,7 +143,6 @@ impl AuraPowerState {
|
||||
}
|
||||
}
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct LaptopAuraPower {
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
use std::fmt::Debug;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
#[cfg(feature = "dbus")]
|
||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||
|
||||
@@ -64,7 +63,6 @@ pub const ORANGE: Colour = Colour {
|
||||
};
|
||||
pub const GRADIENT: [Colour; 7] = [RED, VIOLET, BLUE, TEAL, GREEN, YELLOW, ORANGE];
|
||||
|
||||
#[typeshare]
|
||||
#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))]
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum AuraDeviceType {
|
||||
@@ -116,7 +114,6 @@ impl From<&str> for AuraDeviceType {
|
||||
}
|
||||
|
||||
/// The powerr zones this laptop supports
|
||||
#[typeshare]
|
||||
#[cfg_attr(
|
||||
feature = "dbus",
|
||||
derive(Type, Value, OwnedValue),
|
||||
|
||||
Reference in New Issue
Block a user