pub struct Coordinate {
pub kind: Kind,
pub public_key: PublicKey,
pub identifier: String,
}Expand description
Coordinate for event (a tag)
Fields§
§kind: KindKind
public_key: PublicKeyPublic Key
identifier: Stringd tag identifier
Needed for a parametrized replaceable event. Leave empty for a replaceable event.
Implementations§
Source§impl Coordinate
impl Coordinate
Sourcepub fn parse(coordinate: &str) -> Result<Self, Error>
pub fn parse(coordinate: &str) -> Result<Self, Error>
Parse coordinate from <kind>:<pubkey>:[<d-tag>] format, bech32 or NIP21 uri
Sourcepub fn from_kpi_format(coordinate: &str) -> Result<Self, Error>
pub fn from_kpi_format(coordinate: &str) -> Result<Self, Error>
Try to parse from <kind>:<pubkey>:[<d-tag>] format
Sourcepub fn identifier<S>(self, identifier: S) -> Self
pub fn identifier<S>(self, identifier: S) -> Self
Set a d tag identifier
Needed for a parametrized replaceable event.
Sourcepub fn has_identifier(&self) -> bool
pub fn has_identifier(&self) -> bool
Check if coordinate has identifier
Sourcepub fn verify(&self) -> Result<(), Error>
pub fn verify(&self) -> Result<(), Error>
Sourcepub fn borrow(&self) -> CoordinateBorrow<'_>
pub fn borrow(&self) -> CoordinateBorrow<'_>
Borrow coordinate
Trait Implementations§
Source§impl Clone for Coordinate
impl Clone for Coordinate
Source§fn clone(&self) -> Coordinate
fn clone(&self) -> Coordinate
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 moreSource§impl Debug for Coordinate
impl Debug for Coordinate
Source§impl<'de> Deserialize<'de> for Coordinate
impl<'de> Deserialize<'de> for Coordinate
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 Display for Coordinate
impl Display for Coordinate
Source§impl From<&Coordinate> for Filter
impl From<&Coordinate> for Filter
Source§fn from(value: &Coordinate) -> Self
fn from(value: &Coordinate) -> Self
Converts to this type from the input type.
Source§impl From<Coordinate> for Filter
impl From<Coordinate> for Filter
Source§fn from(value: Coordinate) -> Self
fn from(value: Coordinate) -> Self
Converts to this type from the input type.
Source§impl From<Coordinate> for Tag
impl From<Coordinate> for Tag
Source§fn from(coordinate: Coordinate) -> Self
fn from(coordinate: Coordinate) -> Self
Converts to this type from the input type.
Source§impl FromBech32 for Coordinate
impl FromBech32 for Coordinate
Source§impl FromNostrUri for Coordinate
impl FromNostrUri for Coordinate
Source§impl FromStr for Coordinate
impl FromStr for Coordinate
Source§impl Hash for Coordinate
impl Hash for Coordinate
Source§impl Ord for Coordinate
impl Ord for Coordinate
Source§fn cmp(&self, other: &Coordinate) -> Ordering
fn cmp(&self, other: &Coordinate) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Coordinate
impl PartialEq for Coordinate
Source§impl PartialOrd for Coordinate
impl PartialOrd for Coordinate
Source§impl Serialize for Coordinate
impl Serialize for Coordinate
impl Eq for Coordinate
impl StructuralPartialEq for Coordinate
Auto Trait Implementations§
impl Freeze for Coordinate
impl RefUnwindSafe for Coordinate
impl Send for Coordinate
impl Sync for Coordinate
impl Unpin for Coordinate
impl UnwindSafe for Coordinate
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