pub struct BooleanFilter { /* private fields */ }Expand description
The boolean filter — equality and membership, and the one kind with NO type parameter: bool is
the only type it guards, so there is nothing for a parameter to range over.
Four of ScalarFilter’s eight operators are here and four are not, and ONE rule decides which.
A GraphQL operand is frequently a VARIABLE, and a query document has no expression language to
compute with one — so an operator survives here when its QUESTION is meaningful and its OPERAND
may be unknown until execution. A variable rescues an operator whose operand is unknown. It does
not rescue an operator whose question is meaningless.
ne is the first case. A client that means “not $flag” writes ne: $flag, because
eq: !$flag is not something a query document can write at all. Whether the two coincide for a
LITERAL operand is a property of the LOWERING rather than of the two-valued domain, so it is not
this type’s to decide either way.
in_/not_in are the same case, and “over a two-valued domain membership is degenerate” is that
case misread from the author’s chair. in: [true, false] matches every row and in: [true] is
exactly eq: true — for a reader who knows the operand. A generated or generic client emits
{ field: { in: $values } } over every field type alike and learns what $values holds at
execution time; withhold the slots and that client, and the code generator behind it, needs a
boolean special case. in: [] is the sharper half: a computed set that came out empty means
MATCH NOTHING, which is a set operand like any other and not a shape eq or ne can be given —
so a two-slot filter makes the client detect the empty case and emit something structurally
different.
No ordering, and the variable rescues nothing there. false < true is defined in Rust, but
gt: $flag asks whether one flag exceeds another, which is meaningless however the operand
arrives — gt/gte/lt/lte stay out, and a schema offering them would be inviting a client to
ask it.
Nullability needs nothing added here. Option<bool> resolves to Nullable<BooleanFilter>
through the framework’s one Option blanket, and the null test lives only in that wrapper — as
it does for every other kind.
Implementations§
Source§impl BooleanFilter
impl BooleanFilter
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
True while NO operator slot is set — so a lowering would emit nothing for this field.
Inherent, not the backend traits’ provided is_empty: “is anything set” is a property of the
FILTER, identical on every backend, and asking it should not make a caller name a dialect (with
two families compiled, f.is_empty() through the traits is E0283). The inherent method wins
method resolution, so every call site reads the same either way.
A SET membership slot is non-empty even when the list inside it is: in: [] is the operator
present with an empty operand, which asks for no rows, where an absent in_ asks for all of
them. The question is field presence, never operand length.
Sourcepub fn update_eq(&mut self, value: Option<bool>) -> &mut Self
pub fn update_eq(&mut self, value: Option<bool>) -> &mut Self
Assign the raw eq option (in place).
Sourcepub fn update_ne(&mut self, value: Option<bool>) -> &mut Self
pub fn update_ne(&mut self, value: Option<bool>) -> &mut Self
Assign the raw ne option (in place).
Sourcepub fn in_(&self) -> Option<&[bool]>
pub fn in_(&self) -> Option<&[bool]>
The in_ operands, or None while the operator is absent.
A PRESENT but empty list is not the same as an absent operator: the first asks for no
rows, the second for every row, so Some(&[]) and None say different things.
Sourcepub fn with_in_(self, value: impl Into<Box<[bool]>>) -> Self
pub fn with_in_(self, value: impl Into<Box<[bool]>>) -> Self
Set in_ to Some(value) (consuming).
Sourcepub fn set_in_(&mut self, value: impl Into<Box<[bool]>>) -> &mut Self
pub fn set_in_(&mut self, value: impl Into<Box<[bool]>>) -> &mut Self
Set in_ to Some(value) (in place).
Sourcepub fn maybe_in_(self, value: Option<impl Into<Box<[bool]>>>) -> Self
pub fn maybe_in_(self, value: Option<impl Into<Box<[bool]>>>) -> Self
Assign the in_ list option (consuming).
Sourcepub fn update_in_(&mut self, value: Option<impl Into<Box<[bool]>>>) -> &mut Self
pub fn update_in_(&mut self, value: Option<impl Into<Box<[bool]>>>) -> &mut Self
Assign the in_ list option (in place).
Sourcepub fn not_in(&self) -> Option<&[bool]>
pub fn not_in(&self) -> Option<&[bool]>
The not_in operands, or None while the operator is absent.
A PRESENT but empty list is not the same as an absent operator: the first asks for no
rows, the second for every row, so Some(&[]) and None say different things.
Sourcepub fn with_not_in(self, value: impl Into<Box<[bool]>>) -> Self
pub fn with_not_in(self, value: impl Into<Box<[bool]>>) -> Self
Set not_in to Some(value) (consuming).
Sourcepub fn set_not_in(&mut self, value: impl Into<Box<[bool]>>) -> &mut Self
pub fn set_not_in(&mut self, value: impl Into<Box<[bool]>>) -> &mut Self
Set not_in to Some(value) (in place).
Trait Implementations§
Source§impl Clone for BooleanFilter
impl Clone for BooleanFilter
Source§impl Debug for BooleanFilter
impl Debug for BooleanFilter
Source§impl Default for BooleanFilter
impl Default for BooleanFilter
Source§impl EqualsFilter<bool> for BooleanFilter
The bound’s row: new() and the inherent with_eq, reached where the kind is a parameter rather
than a spelling.
impl EqualsFilter<bool> for BooleanFilter
The bound’s row: new() and the inherent with_eq, reached where the kind is a parameter rather
than a spelling.
Source§impl GraphqlFilter for BooleanFilter
impl GraphqlFilter for BooleanFilter
impl InputObjectType for BooleanFilter
Source§impl InputType for BooleanFilter
impl InputType for BooleanFilter
Source§fn parse(value: Option<Value>) -> InputValueResult<Self>
fn parse(value: Option<Value>) -> InputValueResult<Self>
§The SHORTHAND LAW, at its first face
A bare value is this filter’s eq — rule ① — and a list is refused, since in is an
explicit key. An explicit null is the NULL TEST, which this face has not got: a
NOT NULL column cannot be asked whether it is null, and refusing here is that fact
rather than a gap. See Sent, where the whole law is read.
Source§type RawValueType = BooleanFilter
type RawValueType = BooleanFilter
Source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
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 BooleanFilter
impl NullableFace for BooleanFilter
Source§fn bare_fields(registry: &mut Registry) -> IndexMap<String, MetaInputValue>
fn bare_fields(registry: &mut Registry) -> IndexMap<String, MetaInputValue>
async-graphql only.isNull appended.Source§impl PartialEq for BooleanFilter
impl PartialEq for BooleanFilter
impl StructuralPartialEq for BooleanFilter
Source§impl<V, Db> ToDatabaseComparison<V, Db> for BooleanFilterwhere
Db: Database + for<'q> Backend<Builder<'q> = SqlConjunction<'q, Db>, Buffer: Display>,
V: Carrier<Db>,
Available on crate feature sqlx only.The bounds are the LOWERING’s, restated — which is what the crossing’s item bound costs a row
whose comparison lowers under one generic impl. Db: sqlx::Database stays at the head of them
for the coherence reason SqlScalarComparison’s row records.
impl<V, Db> ToDatabaseComparison<V, Db> for BooleanFilterwhere
Db: Database + for<'q> Backend<Builder<'q> = SqlConjunction<'q, Db>, Buffer: Display>,
V: Carrier<Db>,
sqlx only.The bounds are the LOWERING’s, restated — which is what the crossing’s item bound costs a row
whose comparison lowers under one generic impl. Db: sqlx::Database stays at the head of them
for the coherence reason SqlScalarComparison’s row records.
Source§type Comparison = SqlBooleanComparison<V, Db>
type Comparison = SqlBooleanComparison<V, Db>
V and lowering for Db.Source§impl<V: MongoCarrier> ToDatabaseComparison<V, Mongo> for BooleanFilter
Available on crate feature mongo only.One backend, so one row — and the header is concrete for the coherence reason
MongoScalarComparison’s records.
impl<V: MongoCarrier> ToDatabaseComparison<V, Mongo> for BooleanFilter
mongo only.One backend, so one row — and the header is concrete for the coherence reason
MongoScalarComparison’s records.
Source§type Comparison = MongoBooleanComparison<V>
type Comparison = MongoBooleanComparison<V>
V and lowering for Db.Source§impl<V: TryFrom<bool>> TryFromFilter<BooleanFilter> for MongoBooleanComparison<V>
Available on crate feature mongo only.The crossing with no declared converter. bool stored as bool is the identity and cannot
fail; bool stored as an i32 is a widening From and cannot fail either — so the common
boolean field reaches its comparison with an Infallible error
type.
impl<V: TryFrom<bool>> TryFromFilter<BooleanFilter> for MongoBooleanComparison<V>
mongo only.The crossing with no declared converter. bool stored as bool is the identity and cannot
fail; bool stored as an i32 is a widening From and cannot fail either — so the common
boolean field reaches its comparison with an Infallible error
type.
Source§impl<V, Db> TryFromFilter<BooleanFilter> for SqlBooleanComparison<V, Db>
Available on crate feature sqlx only.The crossing with no declared converter. bool stored as bool is the identity and cannot fail;
bool stored as an i16 or an i32 is a widening From and cannot fail either — so the common
boolean column reaches its comparison with an Infallible error
type.
impl<V, Db> TryFromFilter<BooleanFilter> for SqlBooleanComparison<V, Db>
sqlx only.The crossing with no declared converter. bool stored as bool is the identity and cannot fail;
bool stored as an i16 or an i32 is a widening From and cannot fail either — so the common
boolean column reaches its comparison with an Infallible error
type.
Auto Trait Implementations§
impl Freeze for BooleanFilter
impl RefUnwindSafe for BooleanFilter
impl Send for BooleanFilter
impl Sync for BooleanFilter
impl Unpin for BooleanFilter
impl UnsafeUnpin for BooleanFilter
impl UnwindSafe for BooleanFilter
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.