pub struct Filter {
pub ids: Option<Vec<String, Global>>,
pub authors: Option<Vec<String, Global>>,
pub kinds: Option<Vec<Kind, Global>>,
pub events: Option<Vec<EventId, Global>>,
pub pubkeys: Option<Vec<XOnlyPublicKey, Global>>,
pub hashtags: Option<Vec<String, Global>>,
pub references: Option<Vec<String, Global>>,
pub search: Option<String>,
pub since: Option<Timestamp>,
pub until: Option<Timestamp>,
pub limit: Option<usize>,
pub custom: Map<String, Value>,
}Expand description
Subscription filters
Fields§
§ids: Option<Vec<String, Global>>List of event ids or prefixes
List of pubkeys or prefixes
kinds: Option<Vec<Kind, Global>>List of a kind numbers
events: Option<Vec<EventId, Global>>#e tag
pubkeys: Option<Vec<XOnlyPublicKey, Global>>#p tag
#t tag
references: Option<Vec<String, Global>>#r tag
search: Option<String>It’s a string describing a query in a human-readable form, i.e. “best nostr apps”
since: Option<Timestamp>An integer unix timestamp, events must be newer than this to pass
until: Option<Timestamp>An integer unix timestamp, events must be older than this to pass
limit: Option<usize>Maximum number of events to be returned in the initial query
custom: Map<String, Value>Custom fields
Implementations§
source§impl Filter
impl Filter
sourcepub fn from_json<S>(json: S) -> Result<Filter, Error>where
S: Into<String>,
pub fn from_json<S>(json: S) -> Result<Filter, Error>where S: Into<String>,
Deserialize from JSON string
sourcepub fn ids<S>(self, ids: Vec<S, Global>) -> Filterwhere
S: Into<String>,
pub fn ids<S>(self, ids: Vec<S, Global>) -> Filterwhere S: Into<String>,
Set event ids or prefixes
Set author
Set authors
sourcepub fn pubkey(self, pubkey: XOnlyPublicKey) -> Filter
pub fn pubkey(self, pubkey: XOnlyPublicKey) -> Filter
Set pubkey
Trait Implementations§
source§impl<'de> Deserialize<'de> for Filter
impl<'de> Deserialize<'de> for Filter
source§fn deserialize<D>(
deserializer: D
) -> Result<Filter, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<Filter, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<Filter> for Filter
impl PartialEq<Filter> for Filter
source§impl Serialize for Filter
impl Serialize for Filter
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Filter
impl StructuralEq for Filter
impl StructuralPartialEq for Filter
Auto Trait Implementations§
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnwindSafe for Filter
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.