pub struct Workspace { /* private fields */ }Expand description
Vertrauenswürdiger Wurzelordner für alle Capability-Pfade.
Implementations§
Source§impl Workspace
impl Workspace
Sourcepub fn new(root: impl AsRef<Path>) -> Self
pub fn new(root: impl AsRef<Path>) -> Self
Wurzel ist bereits kanonisiert aufgelöst; schlägt das fehl
(Ordner weg), bleibt der Pfad unvalidiert — resolve prüft dann
gegen dieselbe rohe Wurzel und scheitert konservativ.
Sourcepub fn from_env_or_cwd() -> Self
pub fn from_env_or_cwd() -> Self
RE_WORKSPACE_ROOT, sonst der aktuelle Arbeitsordner des
Prozesses.
pub fn root(&self) -> &Path
Sourcepub fn resolve(&self, raw: &str) -> Result<PathBuf, String>
pub fn resolve(&self, raw: &str) -> Result<PathBuf, String>
Wandelt ein Capability-Argument in einen absoluten Pfad innerhalb
der Workspace um. Abgelehnt werden: leere Pfade, ..-Komponenten
(auch innerhalb gültiger Präfixe), Ausflüge über Symlinks und
absolute Pfade außerhalb der Wurzel. Der Rückgabepfad ist
kanonisiert, soweit der Ordner existiert — die Datei selbst darf
fehlen (Sparziel).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Workspace
impl RefUnwindSafe for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnsafeUnpin for Workspace
impl UnwindSafe for Workspace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more