pub struct ProtectionResult {
pub allowed: bool,
pub warnings: Vec<String>,
pub blocked_reason: Option<String>,
pub suggestion: Option<String>,
}Expand description
Result of a protection check
Fieldsยง
ยงallowed: boolWhether cleaning is allowed
warnings: Vec<String>Warnings to show the user
blocked_reason: Option<String>Reason if blocked
suggestion: Option<String>Suggested action
Implementationsยง
Sourceยงimpl ProtectionResult
impl ProtectionResult
Sourcepub fn with_warning(self, warning: impl Into<String>) -> Self
pub fn with_warning(self, warning: impl Into<String>) -> Self
Add a warning
Sourcepub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
pub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
Add a suggestion
Sourcepub fn has_warnings(&self) -> bool
pub fn has_warnings(&self) -> bool
Check if there are any warnings
Trait Implementationsยง
Sourceยงimpl Clone for ProtectionResult
impl Clone for ProtectionResult
Sourceยงfn clone(&self) -> ProtectionResult
fn clone(&self) -> ProtectionResult
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 ProtectionResult
impl RefUnwindSafe for ProtectionResult
impl Send for ProtectionResult
impl Sync for ProtectionResult
impl Unpin for ProtectionResult
impl UnwindSafe for ProtectionResult
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,
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