1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use crate::cargo::toml;
use std::ops::Deref;
use std::path::{Path, PathBuf};
#[derive(Clone, Debug, Default)]
#[non_exhaustive]
pub struct Workspace<WorkspaceMetadata = ::toml::value::Table> {
pub(crate) directory: PathBuf,
pub(crate) toml: toml::Workspace<WorkspaceMetadata>,
}
impl <WM> Workspace<WM> {
pub fn directory(&self) -> &Path { &self.directory }
pub fn toml(&self) -> &toml::Workspace<WM> { &self.toml }
}
impl<WM> Deref for Workspace<WM> {
type Target = toml::Workspace<WM>;
fn deref(&self) -> &toml::Workspace<WM> { &self.toml }
}