Files
signed/crates/signed_nostr/src/update.rs
T
reya f6b8a5e133
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s
chore: clean up codebase (#19)
Reviewed-on: #19
2026-09-13 09:42:08 +00:00

23 lines
542 B
Rust

use nostr_sdk::prelude::*;
/// A lightweight change notification for the UI.
#[derive(Debug, Clone)]
pub struct Update {
pub kind: Kind,
/// First `a` tag value of the event, if any, for example the repository coordinate.
pub coordinate: Option<Coordinate>,
pub author: PublicKey,
}
impl Update {
pub fn from_event(event: &Event) -> Self {
let coordinate = event.tags.coordinates().nth(0);
Self {
kind: event.kind,
coordinate,
author: event.pubkey,
}
}
}