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