pub struct Filter {
pub ids: SortList<[u8; 32]>,
pub authors: SortList<[u8; 32]>,
pub kinds: SortList<u16>,
pub since: Option<u64>,
pub until: Option<u64>,
pub limit: Option<u64>,
pub search: Option<String>,
pub tags: HashMap<Vec<u8>, SortList<Vec<u8>>>,
pub desc: bool,
pub words: Vec<Vec<u8>>,
}
Expand description
Events filter
Fields§
§ids: SortList<[u8; 32]>
a list of event ids
a list of pubkeys, the pubkey of an event must be one of these
kinds: SortList<u16>
a list of a kind numbers
since: Option<u64>
§until: Option<u64>
§limit: Option<u64>
§search: Option<String>
Keyword search NIP-50 , keywords renamed to search
tags starts with “#”, key tag length 1
desc: bool
Query by time descending order
words: Vec<Vec<u8>>
Implementations§
Source§impl Filter
impl Filter
pub fn default_limit(&mut self, limit: u64)
pub fn match_id(ids: &SortList<[u8; 32]>, id: &[u8; 32]) -> bool
pub fn match_kind(kinds: &SortList<u16>, kind: u16) -> bool
pub fn match_tag<V: AsRef<[u8]>, I: AsRef<[(V, V)]>>( tags: &HashMap<Vec<u8>, SortList<Vec<u8>>>, event_tags: I, ) -> bool
pub fn match(&self, event: &EventIndex) -> bool
pub fn match_except_tag(&self, event: &EventIndex) -> bool
pub fn match_archived(&self, event: &ArchivedEventIndex) -> bool
pub fn match_archived_except_tag(&self, event: &ArchivedEventIndex) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Filter
impl<'de> Deserialize<'de> for Filter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Filter
impl StructuralPartialEq for Filter
Auto Trait Implementations§
impl Freeze for Filter
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnwindSafe for Filter
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.