pub struct RelayFilter {
pub ids: Vec<String>,
pub authors: Vec<String>,
pub kinds: Vec<u16>,
pub since: Option<u64>,
pub until: Option<u64>,
pub limit: Option<u32>,
pub generic_tags: BTreeMap<String, Vec<String>>,
}Expand description
A strict NIP-01 filter that retains generic #<tag> constraints.
Fields§
§ids: Vec<String>Event ID prefixes.
Author public-key prefixes.
kinds: Vec<u16>Exact event kinds.
since: Option<u64>Inclusive lower timestamp bound.
until: Option<u64>Inclusive upper timestamp bound.
limit: Option<u32>Maximum result count.
Generic tag constraints keyed by the one-character tag name.
Implementations§
Source§impl RelayFilter
impl RelayFilter
Sourcepub fn from_json(json: &str) -> Result<Self, SoftchatError>
pub fn from_json(json: &str) -> Result<Self, SoftchatError>
Parse one filter while rejecting duplicate JSON fields and unbounded values.
§Errors
Returns SoftchatError::InvalidRelayFilter for malformed or oversized input.
Sourcepub fn to_json(&self) -> Result<String, SoftchatError>
pub fn to_json(&self) -> Result<String, SoftchatError>
Serialize a canonical compact filter object.
§Errors
Returns SoftchatError::InvalidRelayFilter if the value violates bounds.
Trait Implementations§
Source§impl Clone for RelayFilter
impl Clone for RelayFilter
Source§fn clone(&self) -> RelayFilter
fn clone(&self) -> RelayFilter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RelayFilter
impl Debug for RelayFilter
Source§impl Default for RelayFilter
impl Default for RelayFilter
Source§fn default() -> RelayFilter
fn default() -> RelayFilter
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RelayFilter
impl<'de> Deserialize<'de> for RelayFilter
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
Source§impl PartialEq for RelayFilter
impl PartialEq for RelayFilter
Source§fn eq(&self, other: &RelayFilter) -> bool
fn eq(&self, other: &RelayFilter) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for RelayFilter
impl Serialize for RelayFilter
impl Eq for RelayFilter
impl StructuralPartialEq for RelayFilter
Auto Trait Implementations§
impl Freeze for RelayFilter
impl RefUnwindSafe for RelayFilter
impl Send for RelayFilter
impl Sync for RelayFilter
impl Unpin for RelayFilter
impl UnsafeUnpin for RelayFilter
impl UnwindSafe for RelayFilter
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read more