pub enum GuardrailResult {
Pass,
Tripwire(String),
Warn(String),
}Expand description
Result of a guardrail check.
Variants§
Pass
Input/output is acceptable.
Tripwire(String)
Immediately halt execution. The string explains why.
Warn(String)
Allow execution but log a warning. The string is the warning message.
Implementations§
Source§impl GuardrailResult
impl GuardrailResult
Sourcepub fn is_pass(&self) -> bool
pub fn is_pass(&self) -> bool
Returns true if the result is GuardrailResult::Pass.
Sourcepub fn is_tripwire(&self) -> bool
pub fn is_tripwire(&self) -> bool
Returns true if the result is GuardrailResult::Tripwire.
Sourcepub fn is_warn(&self) -> bool
pub fn is_warn(&self) -> bool
Returns true if the result is GuardrailResult::Warn.
Trait Implementations§
Source§impl Clone for GuardrailResult
impl Clone for GuardrailResult
Source§fn clone(&self) -> GuardrailResult
fn clone(&self) -> GuardrailResult
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 GuardrailResult
impl RefUnwindSafe for GuardrailResult
impl Send for GuardrailResult
impl Sync for GuardrailResult
impl Unpin for GuardrailResult
impl UnsafeUnpin for GuardrailResult
impl UnwindSafe for GuardrailResult
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