26 lines
424 B
Rust
26 lines
424 B
Rust
use uuid::Uuid;
|
|
|
|
pub(crate) struct Metadata {
|
|
id: Uuid,
|
|
name: String,
|
|
}
|
|
|
|
impl Metadata {
|
|
pub(crate) fn new(name: String) -> Self {
|
|
let id = Uuid::new_v4();
|
|
Self { id, name }
|
|
}
|
|
|
|
pub(crate) fn id(&self) -> Uuid {
|
|
self.id
|
|
}
|
|
|
|
pub(crate) fn name(&self) -> &str {
|
|
&self.name
|
|
}
|
|
|
|
pub(crate) fn set_name(&mut self, name: String) {
|
|
self.name = name;
|
|
}
|
|
}
|