#[non_exhaustive]pub enum PolicyError {
EmptyFieldName {
location: PolicyLocation,
},
EmptyFixedReplacement {
location: PolicyLocation,
level: Sensitivity,
},
OutputLimitTooLarge {
maximum: usize,
},
SerdePayloadLimitTooLarge {
maximum: usize,
},
}Expand description
Error returned when a redaction policy contains an invalid rule.
§Examples
use qubit_redact::{PolicyError, RedactionPolicy, Sensitivity};
let error = RedactionPolicy::builder()
.fields(|fields| {
fields.raise("", Sensitivity::Secret);
})
.expect_err("an empty field name is invalid");
assert!(matches!(error, PolicyError::EmptyFieldName { .. }));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
EmptyFieldName
A supplied field name is empty after canonicalization.
Fields
§
location: PolicyLocationLocation where the invalid field was configured.
EmptyFixedReplacement
A fixed mask has an empty replacement at the indicated level.
Fields
§
location: PolicyLocationLocation where the fixed mask was configured.
§
level: SensitivitySensitivity level containing the invalid fixed mask.
OutputLimitTooLarge
The configured output ceiling cannot be represented by Rust’s collection allocators on this platform.
SerdePayloadLimitTooLarge
The logical Serde payload ceiling exceeds addressable capacity.
Trait Implementations§
Source§impl Clone for PolicyError
impl Clone for PolicyError
Source§fn clone(&self) -> PolicyError
fn clone(&self) -> PolicyError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PolicyError
impl Debug for PolicyError
Source§impl Display for PolicyError
impl Display for PolicyError
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
Formats a concise description of the invalid policy configuration.
§Parameters
formatter- Destination formatting context.
§Returns
The formatter result from writing the error description.
§Errors
Returns fmt::Error when the destination rejects a write.
impl Eq for PolicyError
Source§impl Error for PolicyError
impl Error for PolicyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for PolicyError
impl PartialEq for PolicyError
impl StructuralPartialEq for PolicyError
Auto Trait Implementations§
impl Freeze for PolicyError
impl RefUnwindSafe for PolicyError
impl Send for PolicyError
impl Sync for PolicyError
impl Unpin for PolicyError
impl UnsafeUnpin for PolicyError
impl UnwindSafe for PolicyError
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