Enum PredicateType

#[repr(u8)]
pub enum PredicateType {
Show 20 variants XFlags = 0, Hop = 1, XStamp = 2, Xbits0 = 3, Xbits1 = 4, Xbits2 = 5, Xbits3 = 6, Recv = 7, Type = 8, Hash = 9, Group = 10, Domain = 11, Pubkey = 12, Stamp = 13, Size = 14, DataSize = 15, LinksLen = 16, NParts = 17, Prefix = 18, Path = 19,
}
Expand description

A list of all supported query predicates

Variants§

§

XFlags = 0

§“xflags”

(mutable) xflags e.g. [b2:00000000] ( implies EMPTY)

§

Hop = 1

§“xhop”

(mutable) number of hops e.g. [u16:5] ( implies EMPTY)

§

XStamp = 2

§“xstamp”

(mutable) variable stamp e.g. [now] ( implies EMPTY)

§

Xbits0 = 3

§“xbits0”

(mutable) user defined bits e.g. [u32:0] ( implies EMPTY)

§

Xbits1 = 4

§“xbits1”

(mutable) user defined bits e.g. [u32:0] ( implies EMPTY)

§

Xbits2 = 5

§“xbits2”

(mutable) user defined bits e.g. [u32:0] ( implies EMPTY)

§

Xbits3 = 6

§“xbits3”

(mutable) user defined bits e.g. [u32:0] ( implies EMPTY)

§

Recv = 7

§“recv”

the recv time of a packet e.g. [now:+1D] ( implies DATA)

§

Type = 8

§“type”

the field type bits - implied by other predicates e.g. [b2:00000001] ( implies EMPTY)

§

Hash = 9

§“hash”

the point hash e.g. [b:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA] ( implies DATA)

§

Group = 10

§“group”

group id e.g. [#:pub] ( implies LINK)

§

Domain = 11

§“domain”

domain - if fewer than 16 bytes, prepadded with e.g. [a:example] ( implies LINK)

§

Pubkey = 12

§“pubkey”

public key used to sign point e.g. [@:me:local] ( implies SIGNATURE)

§

Stamp = 13

§“stamp”

a stamp - usually microseconds since epoch e.g. [now:-1H] ( implies LINK)

§

Size = 14

§“size”

exact size of the point when using lk_serialize or lk_deserialize - includes xheader and hash e.g. [u16:4] ( implies DATA)

§

DataSize = 15

§“data_size”

the byte size of the data field e.g. [u16:0] ( implies LINK)

§

LinksLen = 16

the number of links in a packet e.g. [u16:0] ( implies LINK)

§

NParts = 17

§“nparts”

the total number of path parts - max 8 e.g. [u8:0] ( implies LINK)

§

Prefix = 18

§“prefix”

all points with path starting with prefix - only accepts ‘=’ op e.g. /hello/world ( implies LINK)

§

Path = 19

§“path”

exact path - only accepts ‘=’ op e.g. /hello/world ( implies LINK)

Implementations§

§

impl PredicateType

pub const ALL: [PredicateType; 20]

pub const PREDICATES: [PredicateType; 20]

pub fn try_from_id(id: &[u8]) -> Option<PredicateType>

pub const fn info(self) -> PredInfo

§

impl PredicateType

pub const fn fixed_size(self) -> Option<usize>

pub fn as_u8(&self) -> u8

pub fn iter_all() -> impl Iterator<Item = PredicateType>

pub fn try_canonical(self, abl: ABList) -> Result<Vec<ABE>, Error>

pub fn canonical(self, abl: &ABList) -> Vec<ABE>

pub fn try_into_fieldenum(self) -> Result<FieldEnum, FieldEnum>

Trait Implementations§

§

impl Clone for PredicateType

§

fn clone(&self) -> PredicateType

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
§

impl Debug for PredicateType

§

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

Formats the value using the given formatter. Read more
§

impl Display for PredicateType

§

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

Formats the value using the given formatter. Read more
§

impl FromStr for PredicateType

§

type Err = Error

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<PredicateType, <PredicateType as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Ord for PredicateType

§

fn cmp(&self, other: &PredicateType) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl PartialEq for PredicateType

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for PredicateType

§

fn partial_cmp(&self, other: &PredicateType) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl TryFrom<FieldEnum> for PredicateType

§

type Error = ()

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

fn try_from(f: FieldEnum) -> Result<PredicateType, ()>

Performs the conversion.
§

impl TryInto<FieldEnum> for PredicateType

§

type Error = FieldEnum

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

fn try_into( self, ) -> Result<FieldEnum, <PredicateType as TryInto<FieldEnum>>::Error>

Performs the conversion.
§

impl Copy for PredicateType

§

impl Eq for PredicateType

§

impl StructuralPartialEq for PredicateType

Auto Trait Implementations§

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more