mindcontrol_types 0.21.0

Mind Control types
Documentation
use litty::literal;
use serde::{Deserialize, Serialize};

/// Log type.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Log {
    /// Log level.
    pub level: LogLevel,
    /// Log content.
    pub content: String,
    /// Unix timestamp in milliseconds.
    pub time: i64,
}

#[literal("info")]
pub struct LogLevelInfo;

#[literal("error")]
pub struct LogLevelError;

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum LogLevel {
    Info(LogLevelInfo),
    Error(LogLevelError),
}