pub enum ParsedField<'a> {
Version(u8),
Id(&'a [u8]),
Pubkey(&'a [u8]),
Sig(&'a [u8]),
CreatedAt(u64),
Kind(u64),
Content(&'a str),
NumTags(u64),
NumTagElems(u64),
Tag(StringType<'a>),
}Expand description
Represents a parsed field from a notepack‐encoded Nostr note.
Each variant corresponds to a logical field in the binary format,
emitted sequentially by the NoteParser iterator as it reads
through the byte stream.
Variants§
Version(u8)
Format version (currently always 1).
Id(&'a [u8])
32‑byte event ID (SHA‑256 of serialized event).
Pubkey(&'a [u8])
32‑byte secp256k1 public key of the author.
Sig(&'a [u8])
64‑byte Schnorr signature of the event ID.
CreatedAt(u64)
Unix timestamp (seconds) of event creation.
Kind(u64)
Event kind (u64 varint).
Content(&'a str)
UTF‑8 encoded event body.
NumTags(u64)
Number of tags present (varint).
NumTagElems(u64)
Number of elements in the next tag (varint).
Tag(StringType<'a>)
A single tag element: either StringType::Str or StringType::Bytes.
Trait Implementations§
Source§impl<'a> Clone for ParsedField<'a>
impl<'a> Clone for ParsedField<'a>
Source§fn clone(&self) -> ParsedField<'a>
fn clone(&self) -> ParsedField<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for ParsedField<'a>
impl<'a> RefUnwindSafe for ParsedField<'a>
impl<'a> Send for ParsedField<'a>
impl<'a> Sync for ParsedField<'a>
impl<'a> Unpin for ParsedField<'a>
impl<'a> UnwindSafe for ParsedField<'a>
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