Skip to main content

OrderTerm

Struct OrderTerm 

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

One term of an order space: the scheme’s term, labelled with the target it was made under.

Under a marker from target the label is a zero-sized type, so two terms of different targets cannot meet in OrderSpace::compare: that does not compile, and nor does a term of a space that places nulls in a plain space’s comparison, or a term of a nulls-first space in a nulls-last space’s, since the policy is part of the Nulls label’s type. Under an OrderTarget the label is stored, and two of different targets compare as None instead of as noise. A RuntimeNulls label stores its policy beside its target, so a nulls-first and a nulls-last term of it compare as None too. Storage reads the scheme’s bytes through AsRef<[u8]>, and raw is the scheme’s term itself.

== compares the stored term, byte for byte, not the value: the order of two values is OrderSpace::compare, and a randomised scheme (block ORE carries a nonce) gives one value many terms, which compare Equal and are not ==.

Implementations§

Source§

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

Source

pub fn target(&self) -> OrderTarget

The target the term was made under.

Source

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

Where the space the term 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 term.

Source

pub fn into_raw(self) -> R

The scheme’s own term, unlabelled.

Source§

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

Source

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

The stored bytes: the scheme’s term’s.

Trait Implementations§

Source§

impl<R: AsRef<[u8]>, T: Target> AsRef<[u8]> for OrderTerm<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 OrderTerm<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: Debug, T: Debug + Target> Debug for OrderTerm<R, T>

Source§

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

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

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

Source§

impl<R: PartialEq, T: PartialEq + Target> PartialEq for OrderTerm<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 OrderTerm<R, T>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<R, T> UnwindSafe for OrderTerm<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.