#[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 copy 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a, C: Context> Readable<'a, C> for EventKind

source§

fn read_from<R: Reader<'a, C>>(reader: &mut R) -> Result<Self, C::Error>

source§

fn minimum_bytes_needed() -> usize

§

fn read_from_buffer_with_ctx( context: C, buffer: &'a [u8] ) -> Result<Self, <C as Context>::Error>

§

fn read_with_length_from_buffer_with_ctx( context: C, buffer: &'a [u8] ) -> (Result<Self, <C as Context>::Error>, usize)

§

fn read_from_buffer_copying_data_with_ctx( context: C, buffer: &[u8] ) -> Result<Self, <C as Context>::Error>

§

fn read_with_length_from_buffer_copying_data_with_ctx( context: C, buffer: &[u8] ) -> (Result<Self, <C as Context>::Error>, usize)

§

fn read_with_length_from_buffer_copying_data_with_ctx_mut( context: &mut C, buffer: &[u8] ) -> (Result<Self, <C as Context>::Error>, usize)

§

fn read_from_stream_unbuffered_with_ctx<S>( context: C, stream: S ) -> Result<Self, <C as Context>::Error>
where S: Read,

§

fn read_from_stream_buffered_with_ctx<S>( context: C, stream: S ) -> Result<Self, <C as Context>::Error>
where S: Read,

§

fn read_from_file_with_ctx( context: C, path: impl AsRef<Path> ) -> Result<Self, <C as Context>::Error>

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<C: Context> Writable<C> for EventKind

source§

fn write_to<T: ?Sized + Writer<C>>( &self, writer: &mut T ) -> Result<(), C::Error>

source§

fn bytes_needed(&self) -> Result<usize, C::Error>

§

fn write_to_buffer_with_ctx( &self, context: C, buffer: &mut [u8] ) -> Result<(), <C as Context>::Error>

§

fn write_to_buffer_with_ctx_mut( &self, context: &mut C, buffer: &mut [u8] ) -> Result<(), <C as Context>::Error>

§

fn write_to_vec_with_ctx( &self, context: C ) -> Result<Vec<u8>, <C as Context>::Error>

§

fn write_to_vec_with_ctx_mut( &self, context: &mut C ) -> Result<Vec<u8>, <C as Context>::Error>

§

fn write_to_stream_with_ctx<S>( &self, context: C, stream: S ) -> Result<(), <C as Context>::Error>
where S: Write,

§

fn write_to_file_with_ctx( &self, context: C, path: impl AsRef<Path> ) -> Result<(), <C as Context>::Error>

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> 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

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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.
§

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

§

fn vzip(self) -> V

source§

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