Skip to main content

QueryTerm

Struct QueryTerm 

Source
pub struct QueryTerm<R, T: Target> { /* private fields */ }
Expand description

One query of an order space: the scheme’s query, labelled with the target it was made under, as an OrderTerm is.

Under a marker from target the label is a zero-sized type, so a query of one target, or of one null policy, cannot meet a term of another in OrderSpace::compare_query: that does not compile. Under an OrderTarget the label is stored, and a query and a term of different targets or policies compare as None instead of as noise.

A query is not a term: it has its own type, so it cannot be compared where a term is expected, and the compiler refuses space.compare(&query, &term). Its bytes are bytes, though, as a term’s are: as_bytes and AsRef<[u8]> are there so a caller can send the query to wherever the terms are, and nothing stops a caller writing them into a term’s place. Under block ORE a query has no right half, so every later compare against those bytes returns None; under a scheme whose Query is its Term the mistake is invisible.

== compares the bytes. Whether that is equality of the values searched for depends on the scheme: under block ORE, whose queries are deterministic, it is. A query is for the comparison at hand and should not be persisted or logged, as OrderQuery explains, so Debug shows the target and masks the query.

Implementations§

Source§

impl<R, T: Target> QueryTerm<R, T>

Source

pub fn target(&self) -> OrderTarget

The target the query was made under.

Source

pub fn null_order(&self) -> Option<NullOrder>

Where the space the query was made in places nulls, or None for a space that gives them no term.

Source

pub fn raw(&self) -> &R

The scheme’s own query.

Source

pub fn into_raw(self) -> R

The scheme’s own query, unlabelled.

Source§

impl<R: AsRef<[u8]>, T: Target> QueryTerm<R, T>

Source

pub fn as_bytes(&self) -> &[u8] ⓘ

The query’s bytes: the scheme’s query’s.

Trait Implementations§

Source§

impl<R: AsRef<[u8]>, T: Target> AsRef<[u8]> for QueryTerm<R, T>

Source§

fn as_ref(&self) -> &[u8] ⓘ

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<R: Clone, T: Clone + Target> Clone for QueryTerm<R, T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R, T> Debug for QueryTerm<R, T>
where T: Debug + Target,

Source§

fn fmt(&self, __opaque_debug_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R: Eq, T: Eq + Target> Eq for QueryTerm<R, T>

Source§

impl<R, T: Target> OpaqueDebug for QueryTerm<R, T>

Source§

impl<R: PartialEq, T: PartialEq + Target> PartialEq for QueryTerm<R, T>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<R: PartialEq, T: PartialEq + Target> StructuralPartialEq for QueryTerm<R, T>

Auto Trait Implementations§

§

impl<R, T> Freeze for QueryTerm<R, T>
where R: Freeze, T: Freeze,

§

impl<R, T> RefUnwindSafe for QueryTerm<R, T>

§

impl<R, T> Send for QueryTerm<R, T>
where R: Send, T: Send,

§

impl<R, T> Sync for QueryTerm<R, T>
where R: Sync, T: Sync,

§

impl<R, T> Unpin for QueryTerm<R, T>
where R: Unpin, T: Unpin,

§

impl<R, T> UnsafeUnpin for QueryTerm<R, T>
where R: UnsafeUnpin, T: UnsafeUnpin,

§

impl<R, T> UnwindSafe for QueryTerm<R, T>
where R: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<S, T, P> Supports<Nulls<T, P>> for S
where S: Supports<T> + ?Sized, T: FixedWidth, P: NullPolicy,

Source§

fn supports(target: Nulls<T, P>) -> bool

Whether the scheme takes terms of target. For a marker, true (the impl exists); for an OrderTarget, the scheme’s list.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.