export patchdb types

This commit is contained in:
Aiden McClelland
2024-03-27 13:58:42 -06:00
parent 5698b830ed
commit f770d5072e
81 changed files with 646 additions and 441 deletions

View File

@@ -3,6 +3,7 @@ use std::collections::BTreeSet;
use imbl::OrdMap;
use tokio::process::Command;
use ts_rs::TS;
use crate::prelude::*;
use crate::util::Invoke;
@@ -13,7 +14,10 @@ pub const GOVERNOR_HEIRARCHY: &[Governor] = &[
Governor(Cow::Borrowed("conservative")),
];
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, serde::Serialize, serde::Deserialize)]
#[derive(
Debug, Clone, PartialEq, Eq, PartialOrd, Ord, serde::Serialize, serde::Deserialize, TS,
)]
#[ts(export, type = "string")]
pub struct Governor(Cow<'static, str>);
impl std::str::FromStr for Governor {
type Err = std::convert::Infallible;

View File

@@ -15,6 +15,7 @@ use serde::de::DeserializeOwned;
use serde::ser::{SerializeMap, SerializeSeq};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde_json::Value;
use ts_rs::TS;
use super::IntoDoubleEndedIterator;
use crate::util::clap::FromStrParser;
@@ -633,7 +634,8 @@ where
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, TS)]
#[ts(export, type = "string")]
pub struct Duration(std::time::Duration);
impl Deref for Duration {
type Target = std::time::Duration;
@@ -1175,7 +1177,8 @@ impl<T: PemEncoding> Pem<T> {
}
}
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, TS)]
#[ts(export, type = "string | number[]")]
pub struct MaybeUtf8String(pub Vec<u8>);
impl std::fmt::Debug for MaybeUtf8String {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {