pub enum SecurityLevel {
Disabled,
Low,
Moderate,
High,
Strict,
}Expand description
How aggressively a client guards server-returned content.
Ordered from least to most aggressive. The default is SecurityLevel::Moderate.
Variants§
Disabled
No guarding at all.
Low
Wrap only clearly-untrusted, unverified tiers.
Moderate
Wrap anything unverified (the default).
High
Wrap everything except verified foundation content.
Strict
Wrap everything, and additionally run removal of flagged content.
Implementations§
Source§impl SecurityLevel
impl SecurityLevel
Sourcepub fn should_wrap(self, attribution: &str, verified: bool) -> bool
pub fn should_wrap(self, attribution: &str, verified: bool) -> bool
Whether content with the given attribution and verified status should
be wrapped in an untrusted block at this level.
attribution uses the snake_case tier names
(foundation | partner | third_party | community | unknown).
Sourcepub const fn runs_pattern_detection(self) -> bool
pub const fn runs_pattern_detection(self) -> bool
Whether this level runs client-side pattern detection on returned content.
Sourcepub const fn strict_removes(self) -> bool
pub const fn strict_removes(self) -> bool
Whether this level removes (rather than merely wraps) flagged content.
Sourcepub const fn wraps_anything(self) -> bool
pub const fn wraps_anything(self) -> bool
Whether this level wraps anything at all (i.e. is not disabled).
Trait Implementations§
Source§impl Clone for SecurityLevel
impl Clone for SecurityLevel
Source§fn clone(&self) -> SecurityLevel
fn clone(&self) -> SecurityLevel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SecurityLevel
Source§impl Debug for SecurityLevel
impl Debug for SecurityLevel
Source§impl Default for SecurityLevel
impl Default for SecurityLevel
Source§fn default() -> SecurityLevel
fn default() -> SecurityLevel
Source§impl<'de> Deserialize<'de> for SecurityLevel
impl<'de> Deserialize<'de> for SecurityLevel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SecurityLevel
Source§impl FromStr for SecurityLevel
impl FromStr for SecurityLevel
Source§impl PartialEq for SecurityLevel
impl PartialEq for SecurityLevel
Source§fn eq(&self, other: &SecurityLevel) -> bool
fn eq(&self, other: &SecurityLevel) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SecurityLevel
impl Serialize for SecurityLevel
impl StructuralPartialEq for SecurityLevel
Auto Trait Implementations§
impl Freeze for SecurityLevel
impl RefUnwindSafe for SecurityLevel
impl Send for SecurityLevel
impl Sync for SecurityLevel
impl Unpin for SecurityLevel
impl UnsafeUnpin for SecurityLevel
impl UnwindSafe for SecurityLevel
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.