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
§“links_len”
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
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
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
impl Clone for PredicateType
§fn clone(&self) -> PredicateType
fn clone(&self) -> PredicateType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for PredicateType
impl Debug for PredicateType
§impl Display for PredicateType
impl Display for PredicateType
§impl FromStr for PredicateType
impl FromStr for PredicateType
§impl Ord for PredicateType
impl Ord for PredicateType
§impl PartialEq for PredicateType
impl PartialEq for PredicateType
§impl PartialOrd for PredicateType
impl PartialOrd for PredicateType
§impl TryFrom<FieldEnum> for PredicateType
impl TryFrom<FieldEnum> for PredicateType
§impl TryInto<FieldEnum> for PredicateType
impl TryInto<FieldEnum> for PredicateType
impl Copy for PredicateType
impl Eq for PredicateType
impl StructuralPartialEq for PredicateType
Auto Trait Implementations§
impl Freeze for PredicateType
impl RefUnwindSafe for PredicateType
impl Send for PredicateType
impl Sync for PredicateType
impl Unpin for PredicateType
impl UnwindSafe for PredicateType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more