Enum EventKind

Source
#[repr(u32)]
pub enum EventKind {
Show 101 variants Metadata = 0, TextNote = 1, RecommendRelay = 2, ContactList = 3, EncryptedDirectMessage = 4, EventDeletion = 5, Repost = 6, Reaction = 7, BadgeAward = 8, GroupChatMessage = 9, GroupChatThreadedReply = 10, GroupChatThread = 11, GroupChatReply = 12, Seal = 13, DmChat = 14, GenericRepost = 16, ChannelCreation = 40, ChannelMetadata = 41, ChannelMessage = 42, ChannelHideMessage = 43, ChannelMuteUser = 44, Bid = 1_021, BidConfirmation = 1_022, Timestamp = 1_040, GiftWrap = 1_059, FileMetadata = 1_063, LiveChatMessage = 1_311, Patches = 1_617, GitIssue = 1_621, GitReply = 1_622, GitStatusOpen = 1_630, GitStatusApplied = 1_631, GitStatusClosed = 1_632, GitStatusDraft = 1_633, ProblemTracker = 1_971, Reporting = 1_984, Label = 1_985, CommunityPost = 4_549, CommunityPostApproval = 4_550, JobFeedback = 7_000, ZapGoal = 9_041, ZapRequest = 9_734, Zap = 9_735, Highlights = 9_802, MuteList = 10_000, PinList = 10_001, RelayList = 10_002, BookmarkList = 10_003, CommunityList = 10_004, PublicChatsList = 10_005, BlockedRelaysList = 10_006, SearchRelaysList = 10_007, UserGroups = 10_009, InterestsList = 10_015, UserEmojiList = 10_030, DmRelayList = 10_050, FileStorageServerList = 10_096, WalletInfo = 13_194, LightningPubRpc = 21_000, Auth = 22_242, WalletRequest = 23_194, WalletResponse = 23_195, NostrConnect = 24_133, HttpAuth = 27_235, FollowSets = 30_000, GenericSets = 30_001, RelaySets = 30_002, BookmarkSets = 30_003, CurationSets = 30_004, ProfileBadges = 30_008, BadgeDefinition = 30_009, InterestSets = 30_015, CreateUpdateStall = 30_017, CreateUpdateProduct = 30_018, MarketplaceUi = 30_019, ProductSoldAuction = 30_020, LongFormContent = 30_023, DraftLongFormContent = 30_024, EmojiSets = 30_030, ReleaseArtifactSets = 30_063, AppSpecificData = 30_078, LiveEvent = 30_311, UserStatus = 30_315, ClassifiedListing = 30_402, DraftClassifiedListing = 30_403, RepositoryAnnouncement = 30_617, WikiArticle = 30_818, DateBasedCalendarEvent = 31_922, TimeBasedCalendarEvent = 31_923, Calendar = 31_924, CalendarEventRsvp = 31_925, HandlerRecommendation = 31_989, HandlerInformation = 31_990, CommunityDefinition = 34_550, JobRequest(u32), JobResult(u32), GroupControl(u32), Replaceable(u32), Ephemeral(u32), GroupMetadata(u32), Other(u32),
}
Expand description

A kind of Event

Variants§

§

Metadata = 0

Event sets the metadata associated with a public key (NIP-01)

§

TextNote = 1

Event is a text note (NIP-01)

§

RecommendRelay = 2

Event contains a relay URL which the author recommends

§

ContactList = 3

Event contains tags which represent the authors contacts including the authors pet names for them (NIP-02)

§

EncryptedDirectMessage = 4

Event is an encrypted direct message (NIP-04)

§

EventDeletion = 5

Event is an authors request to delete previous events (NIP-09)

§

Repost = 6

Repost (NIP-18)

§

Reaction = 7

Event is a reaction to a TextNote event (NIP-25)

§

BadgeAward = 8

Badge Award (NIP-58)

§

GroupChatMessage = 9

Group Chat Message (NIP-29)

§

GroupChatThreadedReply = 10

Group Chat Threaded Reply (NIP-29)

§

GroupChatThread = 11

Group Chat Thread (NIP-29)

§

GroupChatReply = 12

Group Chat Reply (NIP-29)

§

Seal = 13

Seal (NIP-59 PR 716)

§

DmChat = 14

Chat Message / DM (NIP-24 PR 686)

§

GenericRepost = 16

Generic Repost (NIP-18)

§

ChannelCreation = 40

Event creates a public channel (NIP-28)

§

ChannelMetadata = 41

Event sets metadata on a public channel (NIP-28)

§

ChannelMessage = 42

Event creates a message on a public channel (NIP-28)

§

ChannelHideMessage = 43

Event hides a message on a public channel (NIP-28)

§

ChannelMuteUser = 44

Event mutes a user on a public channel (NIP-28)

§

Bid = 1_021

Bid (NIP-15)

§

BidConfirmation = 1_022

Bid Confirmation (NIP-15)

§

Timestamp = 1_040

Timestamps

§

GiftWrap = 1_059

Gift Wrap (NIP-59 PR 716)

§

FileMetadata = 1_063

File Metadata (NIP-94)

§

LiveChatMessage = 1_311

Live Chat Message (NIP-53)

§

Patches = 1_617

Patches (NIP-34)

§

GitIssue = 1_621

Issue (NIP-34)

§

GitReply = 1_622

Replies (NIP-34)

§

GitStatusOpen = 1_630

Status Open (NIP-34)

§

GitStatusApplied = 1_631

Status Applied (NIP-34)

§

GitStatusClosed = 1_632

Status Closed (NIP-34)

§

GitStatusDraft = 1_633

Status Draft (NIP-34)

§

ProblemTracker = 1_971

Problem Tracker (nostrocket-1971)

§

Reporting = 1_984

Reporting (NIP-56)

§

Label = 1_985

Label (NIP-32)

§

CommunityPost = 4_549

Community (exclusive) Post (NIP-72 pr 753)

§

CommunityPostApproval = 4_550

Community Post Approval (NIP-72)

§

JobFeedback = 7_000

Job Feedback (NIP-90)

§

ZapGoal = 9_041

Zap Goal (NIP-75)

§

ZapRequest = 9_734

Zap Request

§

Zap = 9_735

Zap

§

Highlights = 9_802

Highlights (NIP-84)

§

MuteList = 10_000

Mute List (NIP-51)

§

PinList = 10_001

PinList (NIP-51)

§

RelayList = 10_002

Relays List (NIP-65)

§

BookmarkList = 10_003

Bookmarks List (NIP-51)

§

CommunityList = 10_004

Communities List (NIP-51)

§

PublicChatsList = 10_005

Public Chats List (NIP-51)

§

BlockedRelaysList = 10_006

Blocked Relays List (NIP-51)

§

SearchRelaysList = 10_007

Search Relays List (NIP-51)

§

UserGroups = 10_009

User Groups (NIP-51, NIP-29)

§

InterestsList = 10_015

Interests List (NIP-51)

§

UserEmojiList = 10_030

User Emoji List (NIP-51)

§

DmRelayList = 10_050

Relay list to receive DMs (NIP-17)

§

FileStorageServerList = 10_096

File storage server list (NIP-96)

§

WalletInfo = 13_194

Wallet Info (NIP-47)

§

LightningPubRpc = 21_000

Lightning Pub RPC (Lightning.Pub)

§

Auth = 22_242

Client Authentication (NIP-42)

§

WalletRequest = 23_194

Wallet Request (NIP-47)

§

WalletResponse = 23_195

Wallet Response (NIP-47)

§

NostrConnect = 24_133

Nostr Connect (NIP-46)

§

HttpAuth = 27_235

HTTP Auth (NIP-98)

§

FollowSets = 30_000

Categorized People List (NIP-51)

§

GenericSets = 30_001

Categorized Bookmark List (NIP-51)

§

RelaySets = 30_002

Relay Sets (NIP-51)

§

BookmarkSets = 30_003

Bookmark Sets (NIP-51)

§

CurationSets = 30_004

Curation Sets (NIP-51)

§

ProfileBadges = 30_008

Profile Badges (NIP-58)

§

BadgeDefinition = 30_009

Badge Definition (NIP-58)

§

InterestSets = 30_015

Interest Sets (NIP-51)

§

CreateUpdateStall = 30_017

Create or update a stall (NIP-15)

§

CreateUpdateProduct = 30_018

Create or update a product (NIP-15)

§

MarketplaceUi = 30_019

Marketplace UI/UX (NIP-15)

§

ProductSoldAuction = 30_020

Product sold as auction (NIP-15)

§

LongFormContent = 30_023

Long-form Content (NIP-23)

§

DraftLongFormContent = 30_024

Draft Long-form Content (NIP-23)

§

EmojiSets = 30_030

Emoji Sets (NIP-51)

§

ReleaseArtifactSets = 30_063

Release artifact sets (NIP-51)

§

AppSpecificData = 30_078

Application Specific Data, (NIP-78)

§

LiveEvent = 30_311

Live Event (NIP-53)

§

UserStatus = 30_315

User Status (NIP-315 PR 737)

§

ClassifiedListing = 30_402

Classified Listing (NIP-99)

§

DraftClassifiedListing = 30_403

Draft Classified Listing (NIP-99)

§

RepositoryAnnouncement = 30_617

Repository Announcement (NIP-34)

§

WikiArticle = 30_818

Wiki Article (NIP-54)

§

DateBasedCalendarEvent = 31_922

Date-Based Calendar Event (NIP-52)

§

TimeBasedCalendarEvent = 31_923

Time-Based Calendar Event (NIP-52)

§

Calendar = 31_924

Calendar (NIP-52)

§

CalendarEventRsvp = 31_925

Calendar Event RSVP (NIP-52)

§

HandlerRecommendation = 31_989

Handler Recommendation (NIP-89)

§

HandlerInformation = 31_990

Handler Information (NIP-89)

§

CommunityDefinition = 34_550

Community Definition (NIP-72)

§

JobRequest(u32)

Job Request (NIP-90) 5000-5999

§

JobResult(u32)

Job Result (NIP-90) 6000-6999

§

GroupControl(u32)

Group control events (NIP-29) 9000-9030

§

Replaceable(u32)

Relay-specific replaceable event

§

Ephemeral(u32)

Ephemeral event, sent to all clients with matching filters and should not be stored

§

GroupMetadata(u32)

Group Metadata events

§

Other(u32)

Something else?

Implementations§

Source§

impl EventKind

Source

pub fn is_job_request(&self) -> bool

Is a job request kind

Source

pub fn is_job_result(&self) -> bool

Is a job result kind

Source

pub fn is_replaceable(&self) -> bool

If this event kind is a replaceable event NOTE: this INCLUDES parameterized replaceable events

Source

pub fn is_ephemeral(&self) -> bool

If this event kind is ephemeral

Source

pub fn is_parameterized_replaceable(&self) -> bool

If this event kind is parameterized replaceable

If this event kind is feed related.

Source

pub fn is_feed_displayable(&self) -> bool

If this event kind is feed displayable.

Is direct message related

If this event kind augments a feed related event

Source

pub fn contents_are_encrypted(&self) -> bool

If the contents are expected to be encrypted (or empty)

Source

pub fn iter() -> EventKindIterator

This iterates through every well-known EventKind

Trait Implementations§

Source§

impl Clone for EventKind

Source§

fn clone(&self) -> EventKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EventKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for EventKind

Source§

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 From<EventKind> for u32

Source§

fn from(e: EventKind) -> u32

Converts to this type from the input type.
Source§

impl From<u32> for EventKind

Source§

fn from(u: u32) -> Self

Converts to this type from the input type.
Source§

impl Hash for EventKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for EventKind

Source§

fn eq(&self, other: &EventKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for EventKind

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for EventKind

Source§

impl Eq for EventKind

Source§

impl StructuralPartialEq for EventKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,