#[non_exhaustive]pub enum PolicySetError {
Show 13 variants
AlreadyDefined(AlreadyDefined),
Linking(LinkingError),
ExpectedStatic(ExpectedStatic),
ExpectedTemplate(ExpectedTemplate),
PolicyNonexistent(PolicyNonexistentError),
TemplateNonexistent(TemplateNonexistentError),
RemoveTemplateWithActiveLinks(RemoveTemplateWithActiveLinksError),
RemoveTemplateNotTemplate(RemoveTemplateNotTemplateError),
LinkNonexistent(LinkNonexistentError),
UnlinkLinkNotLink(UnlinkLinkNotLinkError),
FromJson(PolicyFromJsonError),
ToJson(PolicyToJsonError),
JsonPolicySet(JsonPolicySetError),
}
Expand description
Potential errors when adding to a PolicySet
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AlreadyDefined(AlreadyDefined)
There was a duplicate PolicyId
encountered in either the set of
templates or the set of policies.
Linking(LinkingError)
Error when linking a template
ExpectedStatic(ExpectedStatic)
Expected a static policy, but a template-linked policy was provided
ExpectedTemplate(ExpectedTemplate)
Expected a template, but a static policy was provided.
PolicyNonexistent(PolicyNonexistentError)
Error when removing a static policy that doesn’t exist
TemplateNonexistent(TemplateNonexistentError)
Error when removing a template that doesn’t exist
RemoveTemplateWithActiveLinks(RemoveTemplateWithActiveLinksError)
Error when removing a template with active links
RemoveTemplateNotTemplate(RemoveTemplateNotTemplateError)
Error when removing a template that is not a template
LinkNonexistent(LinkNonexistentError)
Error when unlinking a linked policy
UnlinkLinkNotLink(UnlinkLinkNotLinkError)
Error when removing a link that is not a link
FromJson(PolicyFromJsonError)
Error when converting a policy/template from JSON format
ToJson(PolicyToJsonError)
Error when converting a policy/template to JSON format
JsonPolicySet(JsonPolicySetError)
Error during JSON ser/de of the policy set (as opposed to individual policies)
Trait Implementations§
source§impl Debug for PolicySetError
impl Debug for PolicySetError
source§impl Diagnostic for PolicySetError
impl Diagnostic for PolicySetError
source§fn code(&self) -> Option<Box<dyn Display + '_>>
fn code(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz
) is recommended, but more classic codes like
E0123
or enums will work just fine.source§fn help(&self) -> Option<Box<dyn Display + '_>>
fn help(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
. Do you have any
advice for the poor soul who’s just run into this issue?source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandler
s to change the display format
of this diagnostic. Read moresource§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Diagnostic
’s Diagnostic::source_code
source§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic
’s Diagnostic::labels
to.Diagnostic
s.source§fn url(&self) -> Option<Box<dyn Display + '_>>
fn url(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
.source§fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
source§impl Display for PolicySetError
impl Display for PolicySetError
source§impl Error for PolicySetError
impl Error for PolicySetError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<AlreadyDefined> for PolicySetError
impl From<AlreadyDefined> for PolicySetError
source§fn from(source: AlreadyDefined) -> Self
fn from(source: AlreadyDefined) -> Self
source§impl From<ExpectedStatic> for PolicySetError
impl From<ExpectedStatic> for PolicySetError
source§fn from(source: ExpectedStatic) -> Self
fn from(source: ExpectedStatic) -> Self
source§impl From<ExpectedTemplate> for PolicySetError
impl From<ExpectedTemplate> for PolicySetError
source§fn from(source: ExpectedTemplate) -> Self
fn from(source: ExpectedTemplate) -> Self
source§impl From<JsonPolicySetError> for PolicySetError
impl From<JsonPolicySetError> for PolicySetError
source§fn from(source: JsonPolicySetError) -> Self
fn from(source: JsonPolicySetError) -> Self
source§impl From<LinkNonexistentError> for PolicySetError
impl From<LinkNonexistentError> for PolicySetError
source§fn from(source: LinkNonexistentError) -> Self
fn from(source: LinkNonexistentError) -> Self
source§impl From<LinkingError> for PolicySetError
impl From<LinkingError> for PolicySetError
source§fn from(source: LinkingError) -> Self
fn from(source: LinkingError) -> Self
source§impl From<PolicyFromJsonError> for PolicySetError
impl From<PolicyFromJsonError> for PolicySetError
source§fn from(source: PolicyFromJsonError) -> Self
fn from(source: PolicyFromJsonError) -> Self
source§impl From<PolicyNonexistentError> for PolicySetError
impl From<PolicyNonexistentError> for PolicySetError
source§fn from(source: PolicyNonexistentError) -> Self
fn from(source: PolicyNonexistentError) -> Self
source§fn from(source: PolicySetError) -> Self
fn from(source: PolicySetError) -> Self
source§impl From<PolicyToJsonError> for PolicySetError
impl From<PolicyToJsonError> for PolicySetError
source§fn from(source: PolicyToJsonError) -> Self
fn from(source: PolicyToJsonError) -> Self
source§impl From<RemoveTemplateNotTemplateError> for PolicySetError
impl From<RemoveTemplateNotTemplateError> for PolicySetError
source§fn from(source: RemoveTemplateNotTemplateError) -> Self
fn from(source: RemoveTemplateNotTemplateError) -> Self
source§impl From<RemoveTemplateWithActiveLinksError> for PolicySetError
impl From<RemoveTemplateWithActiveLinksError> for PolicySetError
source§fn from(source: RemoveTemplateWithActiveLinksError) -> Self
fn from(source: RemoveTemplateWithActiveLinksError) -> Self
source§impl From<TemplateNonexistentError> for PolicySetError
impl From<TemplateNonexistentError> for PolicySetError
source§fn from(source: TemplateNonexistentError) -> Self
fn from(source: TemplateNonexistentError) -> Self
source§impl From<UnlinkLinkNotLinkError> for PolicySetError
impl From<UnlinkLinkNotLinkError> for PolicySetError
source§fn from(source: UnlinkLinkNotLinkError) -> Self
fn from(source: UnlinkLinkNotLinkError) -> Self
Auto Trait Implementations§
impl Freeze for PolicySetError
impl !RefUnwindSafe for PolicySetError
impl Send for PolicySetError
impl Sync for PolicySetError
impl Unpin for PolicySetError
impl !UnwindSafe for PolicySetError
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
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>
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>
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