#[non_exhaustive]pub enum CommentScope {
Event {
id: EventId,
relay_hint: Option<RelayUrl>,
},
Address {
coordinate: Coordinate,
relay_hint: Option<RelayUrl>,
},
External {
value: String,
context: Option<String>,
},
}Expand description
What a comment is rooted at or replying to.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Event
A regular event id.
Address
A parameterized replaceable event coordinate.
Fields
§
coordinate: Coordinate(kind, author, identifier) of the addressable event.
External
An external identifier (NIP-73), e.g. a URL.
Implementations§
Source§impl CommentScope
impl CommentScope
Sourcepub const fn event(id: EventId) -> Self
pub const fn event(id: EventId) -> Self
Construct an CommentScope::Event without a relay hint.
Sourcepub const fn address(coordinate: Coordinate) -> Self
pub const fn address(coordinate: Coordinate) -> Self
Construct an CommentScope::Address without a relay hint.
Sourcepub fn external(value: impl Into<String>) -> Self
pub fn external(value: impl Into<String>) -> Self
Construct an CommentScope::External from an identifier.
Trait Implementations§
Source§impl Clone for CommentScope
impl Clone for CommentScope
Source§fn clone(&self) -> CommentScope
fn clone(&self) -> CommentScope
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 CommentScope
impl Debug for CommentScope
impl Eq for CommentScope
Source§impl Hash for CommentScope
impl Hash for CommentScope
Source§impl PartialEq for CommentScope
impl PartialEq for CommentScope
Source§fn eq(&self, other: &CommentScope) -> bool
fn eq(&self, other: &CommentScope) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CommentScope
Auto Trait Implementations§
impl Freeze for CommentScope
impl RefUnwindSafe for CommentScope
impl Send for CommentScope
impl Sync for CommentScope
impl Unpin for CommentScope
impl UnsafeUnpin for CommentScope
impl UnwindSafe for CommentScope
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.