Files
gdriver2/gdriver-common/src/drive_structure.rs
OMGeeky 6d3640ce78 expand service methods a bit
(without implementations, just the trait)
2024-01-31 19:19:11 +01:00

25 lines
561 B
Rust

pub mod drive_id {
use lazy_static::lazy_static;
use serde::{Deserialize, Serialize};
lazy_static! {
pub static ref ROOT_ID: DriveId = DriveId(String::from("root"));
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct DriveId(pub String);
impl<T> From<T> for DriveId
where
T: Into<String>,
{
fn from(s: T) -> Self {
DriveId(s.into())
}
}
impl AsRef<str> for DriveId {
fn as_ref(&self) -> &str {
&self.0
}
}
}