pub struct PolicyStore {
pub root: PathBuf,
}Fields§
§root: PathBufImplementations§
Source§impl PolicyStore
impl PolicyStore
pub fn open(root: impl AsRef<Path>) -> Result<Self>
pub fn default_root() -> PathBuf
pub fn schema_path(&self) -> PathBuf
pub fn policies_dir(&self) -> PathBuf
pub fn load_policies(&self) -> Result<(PolicySet, Vec<PolicySource>)>
pub fn load_schema(&self) -> Result<Option<SchemaParsed>>
pub fn validate(&self) -> Result<ValidationReport>
Sourcepub fn write_policy(&self, name: &str, text: &str) -> Result<PathBuf>
pub fn write_policy(&self, name: &str, text: &str) -> Result<PathBuf>
Write a policy file under policies/. name is sanitized to a
single filename component: path separators and .. segments are
stripped, and the result is rejected if it would be empty or a
parent-directory reference.
pub fn write_schema(&self, text: &str) -> Result<()>
Trait Implementations§
Source§impl Clone for PolicyStore
impl Clone for PolicyStore
Source§fn clone(&self) -> PolicyStore
fn clone(&self) -> PolicyStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PolicyStore
impl RefUnwindSafe for PolicyStore
impl Send for PolicyStore
impl Sync for PolicyStore
impl Unpin for PolicyStore
impl UnwindSafe for PolicyStore
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more