pub struct ProjectTrustStore { /* private fields */ }Expand description
Atomic persistent project-trust repository keyed by canonical workspace.
Implementations§
Source§impl ProjectTrustStore
impl ProjectTrustStore
Sourcepub fn new(path: impl Into<PathBuf>) -> Self
pub fn new(path: impl Into<PathBuf>) -> Self
Creates a repository at an injected path without touching a real home.
Sourcepub fn get(
&self,
workspace: &Path,
) -> Result<Option<PersistedTrustDecision>, CodingError>
pub fn get( &self, workspace: &Path, ) -> Result<Option<PersistedTrustDecision>, CodingError>
Returns a saved decision for the canonical workspace.
§Errors
Rejects non-canonical workspaces and invalid/oversized trust files.
Sourcepub fn set(
&self,
workspace: &Path,
decision: PersistedTrustDecision,
) -> Result<(), CodingError>
pub fn set( &self, workspace: &Path, decision: PersistedTrustDecision, ) -> Result<(), CodingError>
Atomically persists one decision with owner-only Unix permissions.
§Errors
Returns a bounded persistence error if the state cannot be committed.
Sourcepub fn resolve(
&self,
workspace: &Path,
request: TrustRequest,
mode: InteractionMode,
) -> Result<ProjectAccess, CodingError>
pub fn resolve( &self, workspace: &Path, request: TrustRequest, mode: InteractionMode, ) -> Result<ProjectAccess, CodingError>
Resolves a request without reading project-local content.
§Errors
Non-interactive undecided/rejected projects fail closed.
Trait Implementations§
Source§impl Clone for ProjectTrustStore
impl Clone for ProjectTrustStore
Auto Trait Implementations§
impl Freeze for ProjectTrustStore
impl RefUnwindSafe for ProjectTrustStore
impl Send for ProjectTrustStore
impl Sync for ProjectTrustStore
impl Unpin for ProjectTrustStore
impl UnsafeUnpin for ProjectTrustStore
impl UnwindSafe for ProjectTrustStore
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