pub struct ScopeStore { /* private fields */ }Implementations§
Source§impl ScopeStore
impl ScopeStore
pub fn roots(&self) -> &[PathBuf]
pub fn load(file: &Path) -> Self
pub fn load_with_home(file: &Path, home: Option<&Path>) -> Self
Sourcepub fn save(&self, file: &Path) -> Result<(), ScopeError>
pub fn save(&self, file: &Path) -> Result<(), ScopeError>
Written atomically: a crash mid-write never loses the grants.
Sourcepub fn grant(&mut self, folder: &Path) -> Result<PathBuf, ScopeError>
pub fn grant(&mut self, folder: &Path) -> Result<PathBuf, ScopeError>
Grants a folder (idempotent). Returns the canonical path stored.
pub fn grant_with_home( &mut self, folder: &Path, home: Option<&Path>, ) -> Result<PathBuf, ScopeError>
pub fn revoke(&mut self, folder: &Path) -> bool
pub fn revoke_all(&mut self)
Sourcepub fn resolve(&self, path: &Path) -> Result<ScopedPath, ScopeError>
pub fn resolve(&self, path: &Path) -> Result<ScopedPath, ScopeError>
Resolves path to its canonical form iff it lies inside a granted folder and is not a
sensitive location. This is the one gate every read goes through.
pub fn resolve_with_home( &self, path: &Path, home: Option<&Path>, ) -> Result<ScopedPath, ScopeError>
Trait Implementations§
Source§impl Clone for ScopeStore
impl Clone for ScopeStore
Source§impl Debug for ScopeStore
impl Debug for ScopeStore
Source§impl Default for ScopeStore
impl Default for ScopeStore
Source§impl<'de> Deserialize<'de> for ScopeStore
impl<'de> Deserialize<'de> for ScopeStore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ScopeStore
Source§impl PartialEq for ScopeStore
impl PartialEq for ScopeStore
Source§impl Serialize for ScopeStore
impl Serialize for ScopeStore
impl StructuralPartialEq for ScopeStore
Auto Trait Implementations§
impl Freeze for ScopeStore
impl RefUnwindSafe for ScopeStore
impl Send for ScopeStore
impl Sync for ScopeStore
impl Unpin for ScopeStore
impl UnsafeUnpin for ScopeStore
impl UnwindSafe for ScopeStore
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