pub struct HandlerInformation {
pub identifier: String,
pub content: String,
pub supported_kinds: Vec<Kind>,
pub platforms: Vec<HandlerPlatformEntry>,
pub extra_tags: Vec<Tag>,
}Expand description
Typed bundle for a kind: 31990 handler event.
Fields§
§identifier: Stringd-tag value — handler identifier (free-form).
content: String.content — optional stringified kind: 0-shaped JSON.
supported_kinds: Vec<Kind>Supported event kinds (k tags).
platforms: Vec<HandlerPlatformEntry>Platform-specific entry points.
Forward-compatible passthrough for unknown tags.
Implementations§
Source§impl HandlerInformation
impl HandlerInformation
Sourcepub fn new(identifier: impl Into<String>) -> Self
pub fn new(identifier: impl Into<String>) -> Self
Construct an empty handler bundle bound to identifier.
Sourcepub fn content(self, content: impl Into<String>) -> Self
pub fn content(self, content: impl Into<String>) -> Self
Replace Self::content.
Sourcepub fn platform(self, entry: HandlerPlatformEntry) -> Self
pub fn platform(self, entry: HandlerPlatformEntry) -> Self
Append a platform entry.
Sourcepub fn coordinate(&self, author: PublicKey) -> Coordinate
pub fn coordinate(&self, author: PublicKey) -> Coordinate
Build the handler’s addressable coordinate.
Sourcepub fn from_event(event: &Event) -> Result<Self, HandlerError>
pub fn from_event(event: &Event) -> Result<Self, HandlerError>
Parse a kind: 31990 event back into a typed bundle.
§Errors
HandlerError::WrongKindfor any other kind.HandlerError::MissingIdentifierwhen thedtag is absent.HandlerError::InvalidKindwhen aktag has a value that is not au16.
Trait Implementations§
Source§impl Clone for HandlerInformation
impl Clone for HandlerInformation
Source§fn clone(&self) -> HandlerInformation
fn clone(&self) -> HandlerInformation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HandlerInformation
impl Debug for HandlerInformation
impl Eq for HandlerInformation
Source§impl PartialEq for HandlerInformation
impl PartialEq for HandlerInformation
impl StructuralPartialEq for HandlerInformation
Auto Trait Implementations§
impl Freeze for HandlerInformation
impl RefUnwindSafe for HandlerInformation
impl Send for HandlerInformation
impl Sync for HandlerInformation
impl Unpin for HandlerInformation
impl UnsafeUnpin for HandlerInformation
impl UnwindSafe for HandlerInformation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.