mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
reorganize package data and write dependencies rpc (#2571)
* wip * finish dependencies * minor fixes
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user