pub struct Event {
pub words: Vec<Vec<u8>>,
/* private fields */
}
Expand description
The default event document.
Fields§
§words: Vec<Vec<u8>>
Implementations§
Source§impl Event
impl Event
pub fn index(&self) -> &EventIndex
pub fn id(&self) -> &[u8; 32]
pub fn id_str(&self) -> String
pub fn pubkey(&self) -> &[u8; 32]
pub fn pubkey_str(&self) -> String
pub fn created_at(&self) -> u64
pub fn kind(&self) -> u16
pub fn content(&self) -> &String
pub fn sig(&self) -> &[u8; 64]
Source§impl Event
impl Event
pub fn hash(&self) -> [u8; 32]
pub fn verify_id(&self) -> Result<(), Error>
pub fn verify_sign(&self) -> Result<(), Error>
Sourcepub fn verify_time(&self, now: u64, older: u64, newer: u64) -> Result<(), Error>
pub fn verify_time(&self, now: u64, older: u64, newer: u64) -> Result<(), Error>
check event created time newer than (now - older), older than (now + newer) ignore when 0
pub fn verify_delegation(&self) -> Result<(), Error>
pub fn validate(&self, now: u64, older: u64, newer: u64) -> Result<(), Error>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 FromEventData for Event
Parse the json string to event object
impl FromEventData for Event
Parse the json string to event object
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.