pub struct DetectedLanguageFilter { /* private fields */ }derive only.Expand description
The filter that guards a DetectedLanguage column: the whole IDENTITY axis flattened, and the
CONFIDENCE nested beside it.
| facet | slots | operand | asks about |
|---|---|---|---|
| IDENTITY | eq, ne, in, notIn | LanguageIdOperand | the whole detected tag |
| COMPONENT | language, script, region | the three subtags | one seat of it |
| CONFIDENCE | confidence | Score | how sure the detector was |
§The identity axis FLATTENS and the confidence does not
A client writes { language: { eq: "zh" } } where it writes { confidence: { gte: 0.8 } }, and
the asymmetry is the one every detection filter makes and for its reason. What a detection IS is
the language: that is the crossing, and a whole-identity eq on a
face carrying both would have nothing to disambiguate. The confidence is an ATTRIBUTE of that
identity, and a bare eq on a face carrying both would have to pick which of them it meant.
The flattened component is LanguageIdFilter WHOLE, so all seven of its slots arrive — the four
identity words and the three component filters, isNull included. Nothing is restated here and
nothing can drift: a slot added to that filter appears on this face with it.
§The two guard ONE detection, and that is why they share a filter
A track carries k (language, confidence) pairs. Were the two questions asked of the track
separately, German above 0.8 would be answered by a track where German scored 0.2 and English
scored 0.9 — each half true of a different detection. Holding both in one filter over one
detection makes that unrepresentable rather than merely wrong.
§confidence takes the framework’s SIX confidence words
The facet is ConfidenceFilter — eq, ne, gt, gte, lt, lte — and every one of them
is well-defined, because Score’s constructor refuses NaN and the resulting order is total.
eq and ne earn their place: eq: 1.0 is a saturated detector and ne: 0.0 is was it a
candidate at all, both exactly representable and both genuinely asked.
in and notIn are ABSENT FROM THE KIND rather than declined here — a membership list over a
continuous measurement resolves each member at a width the client cannot see, so it answers no
rows to a question the caller believed they had asked. See ConfidenceFilter, where the
framework argues it.
§The wire face is DECLARED, not written
#[ingraph(composed)], and the identity component carries #[ingraph(flatten)]. Declaration
order IS publication order, so the confidence is published last, after the seven the splice
brings.
Implementations§
Source§impl DetectedLanguageFilter
impl DetectedLanguageFilter
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
True while NO operator slot is set on EITHER facet.
NOT const, for the reason LanguageIdFilter::is_empty is not: a nullable component’s own
emptiness is the framework’s arithmetic and not a const fn.
Sourcepub const fn language(&self) -> &LanguageIdFilter
pub const fn language(&self) -> &LanguageIdFilter
The detected identity’s filter — the axis the wire face publishes FLATTENED.
Sourcepub const fn confidence(&self) -> Option<&ConfidenceFilter>
pub const fn confidence(&self) -> Option<&ConfidenceFilter>
The confidence’s filter.
Sourcepub fn with_language(self, language: LanguageIdFilter) -> Self
pub fn with_language(self, language: LanguageIdFilter) -> Self
Replace the identity’s filter (consuming).
Sourcepub fn set_language(&mut self, language: LanguageIdFilter) -> &mut Self
pub fn set_language(&mut self, language: LanguageIdFilter) -> &mut Self
Replace the identity’s filter (in place).
Sourcepub fn with_confidence(self, confidence: ConfidenceFilter) -> Self
pub fn with_confidence(self, confidence: ConfidenceFilter) -> Self
Replace the confidence’s filter (consuming).
Sourcepub fn set_confidence(&mut self, confidence: ConfidenceFilter) -> &mut Self
pub fn set_confidence(&mut self, confidence: ConfidenceFilter) -> &mut Self
Replace the confidence’s filter (in place).
Trait Implementations§
Source§impl Clone for DetectedLanguageFilter
impl Clone for DetectedLanguageFilter
Source§impl Debug for DetectedLanguageFilter
impl Debug for DetectedLanguageFilter
Source§impl Default for DetectedLanguageFilter
impl Default for DetectedLanguageFilter
impl InputObjectType for DetectedLanguageFilter
Source§impl InputType for DetectedLanguageFilter
impl InputType for DetectedLanguageFilter
Source§type RawValueType = DetectedLanguageFilter
type RawValueType = DetectedLanguageFilter
Source§fn create_type_info(__ingraph_registry: &mut Registry) -> String
fn create_type_info(__ingraph_registry: &mut Registry) -> String
Source§fn parse(__ingraph_value: Option<Value>) -> InputValueResult<Self>
fn parse(__ingraph_value: Option<Value>) -> InputValueResult<Self>
Value. None represents undefined.Source§fn as_raw_value(&self) -> Option<&Self::RawValueType>
fn as_raw_value(&self) -> Option<&Self::RawValueType>
Source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Source§impl NullableFace for DetectedLanguageFilter
impl NullableFace for DetectedLanguageFilter
Source§fn bare_fields(
__ingraph_registry: &mut Registry,
) -> IndexMap<String, MetaInputValue>
fn bare_fields( __ingraph_registry: &mut Registry, ) -> IndexMap<String, MetaInputValue>
async-graphql only.isNull appended.Source§impl PartialEq for DetectedLanguageFilter
impl PartialEq for DetectedLanguageFilter
impl StructuralPartialEq for DetectedLanguageFilter
Source§impl<Db> ToDatabaseComparison<(String, Confidence<f32>), Db> for DetectedLanguageFilter
Available on crate feature sqlx only.Every SQL dialect takes the detection filter to the detection comparison, and the storage type is
the PAIR rather than a parameter.
impl<Db> ToDatabaseComparison<(String, Confidence<f32>), Db> for DetectedLanguageFilter
sqlx only.Every SQL dialect takes the detection filter to the detection comparison, and the storage type is the PAIR rather than a parameter.
V is (String, Score) because the two halves hold different types, and one scalar V would
name one of them and hide the other — the shape every PAIRED comparison states. The identity’s
four columns are all String, which is why one word covers them.
Source§type Comparison = SqlDetectedLanguageComparison<Db>
type Comparison = SqlDetectedLanguageComparison<Db>
V and lowering for Db.Source§impl<Db> TryFromFilter<DetectedLanguageFilter> for SqlDetectedLanguageComparison<Db>
Available on crate feature sqlx only.The crossing, and the only route into a SqlDetectedLanguageComparison.
impl<Db> TryFromFilter<DetectedLanguageFilter> for SqlDetectedLanguageComparison<Db>
sqlx only.The crossing, and the only route into a SqlDetectedLanguageComparison.
TryFromFilter because the identity’s crossing can refuse, and the error is ITS error rather
than a second one wrapping it: the doubled equality is the same mistake in the same place,
whether the identity is a column of its own or a detection’s half.
Source§type Error = LanguageIdCrossingError
type Error = LanguageIdCrossingError
Source§fn try_from_filter(filter: DetectedLanguageFilter) -> Result<Self, Self::Error>
fn try_from_filter(filter: DetectedLanguageFilter) -> Result<Self, Self::Error>
filter into this comparison, or report why an operand could not follow.Auto Trait Implementations§
impl !Freeze for DetectedLanguageFilter
impl RefUnwindSafe for DetectedLanguageFilter
impl Send for DetectedLanguageFilter
impl Sync for DetectedLanguageFilter
impl Unpin for DetectedLanguageFilter
impl UnsafeUnpin for DetectedLanguageFilter
impl UnwindSafe for DetectedLanguageFilter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<C> FlattenFace for Cwhere
C: NullableFace,
impl<C> FlattenFace for Cwhere
C: NullableFace,
Source§fn flat_read<F>(
object: &IndexMap<Name, ConstValue>,
) -> Result<C, InputValueError<F>>where
F: InputType,
Available on crate feature async-graphql only.
fn flat_read<F>(
object: &IndexMap<Name, ConstValue>,
) -> Result<C, InputValueError<F>>where
F: InputType,
async-graphql only.The object is CLONED, and the clone is the honest cost of splicing: the component’s parser takes an owned value, and the host’s other fields are read off the same object either side of this call. Handing the last splice the owned map would save one clone in the one-splice case and make the emission depend on which field came last.
Source§fn flat_fields(registry: &mut Registry) -> IndexMap<String, MetaInputValue>
fn flat_fields(registry: &mut Registry) -> IndexMap<String, MetaInputValue>
async-graphql only.Source§fn flat_values(&self) -> IndexMap<Name, ConstValue>
fn flat_values(&self) -> IndexMap<Name, ConstValue>
async-graphql only.Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.impl<T> Fruit for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> SearchOptionsFace for Twhere
T: InputType,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.