reorganize package data and write dependencies rpc (#2571)

* wip

* finish dependencies

* minor fixes
This commit is contained in:
Aiden McClelland
2024-03-15 13:02:47 -06:00
committed by GitHub
parent e604c914d1
commit 1a396cfc7b
30 changed files with 1045 additions and 897 deletions

View File

@@ -1,8 +1,9 @@
use std::path::Path;
use std::str::FromStr;
use serde::{Deserialize, Deserializer, Serialize};
use crate::Id;
use crate::{Id, InvalidId};
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, ts_rs::TS)]
pub struct HealthCheckId(Id);
@@ -11,6 +12,12 @@ impl std::fmt::Display for HealthCheckId {
write!(f, "{}", &self.0)
}
}
impl FromStr for HealthCheckId {
type Err = InvalidId;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Id::from_str(s).map(HealthCheckId)
}
}
impl AsRef<str> for HealthCheckId {
fn as_ref(&self) -> &str {
self.0.as_ref()

View File

@@ -1,4 +1,5 @@
use std::borrow::Borrow;
use std::str::FromStr;
use regex::Regex;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
@@ -59,6 +60,12 @@ impl TryFrom<&str> for Id {
}
}
}
impl FromStr for Id {
type Err = InvalidId;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Self::try_from(s)
}
}
impl From<Id> for InternedString {
fn from(value: Id) -> Self {
value.0