mirror of
https://github.com/OMGeeky/gdriver2.git
synced 2025-12-31 08:49:58 +01:00
25 lines
561 B
Rust
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
|
|
}
|
|
}
|
|
}
|