pub enum ClientRelayFrame {
Event(SignedNostrEvent),
Events(Vec<SignedNostrEvent>),
Req {
subscription_id: String,
filters: Vec<RelayFilter>,
},
Close {
subscription_id: String,
},
Count {
subscription_id: String,
filters: Vec<RelayFilter>,
},
Auth(SignedNostrEvent),
}Expand description
A validated client-to-relay frame.
Variants§
Event(SignedNostrEvent)
Publish one event.
Events(Vec<SignedNostrEvent>)
Publish a non-empty collection through Softchat’s extension.
Req
Open or replace one subscription.
Fields
§
filters: Vec<RelayFilter>One or more strict filters.
Close
Close one subscription.
Count
Request a count for one or more filters.
Fields
§
filters: Vec<RelayFilter>One or more strict filters.
Auth(SignedNostrEvent)
Submit one signed NIP-42 authentication event.
Implementations§
Source§impl ClientRelayFrame
impl ClientRelayFrame
Sourcepub fn to_json(&self) -> Result<String, SoftchatError>
pub fn to_json(&self) -> Result<String, SoftchatError>
Serialize this frame as compact JSON.
§Errors
Returns SoftchatError::InvalidRelayFrame if serialization exceeds bounds.
Trait Implementations§
Source§impl Clone for ClientRelayFrame
impl Clone for ClientRelayFrame
Source§fn clone(&self) -> ClientRelayFrame
fn clone(&self) -> ClientRelayFrame
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 ClientRelayFrame
impl Debug for ClientRelayFrame
Source§impl PartialEq for ClientRelayFrame
impl PartialEq for ClientRelayFrame
Source§fn eq(&self, other: &ClientRelayFrame) -> bool
fn eq(&self, other: &ClientRelayFrame) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ClientRelayFrame
impl StructuralPartialEq for ClientRelayFrame
Auto Trait Implementations§
impl !Freeze for ClientRelayFrame
impl RefUnwindSafe for ClientRelayFrame
impl Send for ClientRelayFrame
impl Sync for ClientRelayFrame
impl Unpin for ClientRelayFrame
impl UnsafeUnpin for ClientRelayFrame
impl UnwindSafe for ClientRelayFrame
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