pub enum GateReason {
Silence,
Uniform,
}Expand description
Why the gate refused a blob.
One variant per modality, because one measurement per modality is what the
gate makes. The token is stored in media_content.skip_reason and is part of
a CHECK constraint, so adding a variant is a schema change, not a rename.
Variants§
Silence
An audio clip whose RMS amplitude was at or below the silence threshold.
Uniform
An image whose luma variance was at or below the uniformity threshold.
Implementations§
Source§impl GateReason
impl GateReason
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Stable token used in the SQLite store and in --json output.
Sourcepub fn from_token(s: &str) -> Option<Self>
pub fn from_token(s: &str) -> Option<Self>
Parse a reason from its stable token; None for an unrecognised value (a
corrupt row).
Sourcepub fn metric(self) -> &'static str
pub fn metric(self) -> &'static str
The name of the quantity that was measured, as printed beside the value:
rms for silence, variance for uniformity.
Sourcepub fn threshold_name(self) -> &'static str
pub fn threshold_name(self) -> &'static str
The threshold’s name in prose, for the one-line explanation.
Trait Implementations§
Source§impl Clone for GateReason
impl Clone for GateReason
Source§fn clone(&self) -> GateReason
fn clone(&self) -> GateReason
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 moreimpl Copy for GateReason
Source§impl Debug for GateReason
impl Debug for GateReason
Source§impl<'de> Deserialize<'de> for GateReason
impl<'de> Deserialize<'de> for GateReason
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for GateReason
impl Display for GateReason
impl Eq for GateReason
Source§impl Ord for GateReason
impl Ord for GateReason
Source§fn cmp(&self, other: &GateReason) -> Ordering
fn cmp(&self, other: &GateReason) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for GateReason
impl PartialEq for GateReason
Source§impl PartialOrd for GateReason
impl PartialOrd for GateReason
Source§impl Serialize for GateReason
impl Serialize for GateReason
impl StructuralPartialEq for GateReason
Auto Trait Implementations§
impl Freeze for GateReason
impl RefUnwindSafe for GateReason
impl Send for GateReason
impl Sync for GateReason
impl Unpin for GateReason
impl UnsafeUnpin for GateReason
impl UnwindSafe for GateReason
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.