pub struct Metadata {
pub name: Option<String>,
pub display_name: Option<String>,
pub about: Option<String>,
pub website: Option<String>,
pub picture: Option<String>,
pub banner: Option<String>,
pub nip05: Option<String>,
pub lud06: Option<String>,
pub lud16: Option<String>,
pub custom: BTreeMap<String, Value, Global>,
}
Expand description
Metadata
Fields§
§name: Option<String>
Name
display_name: Option<String>
Display name
about: Option<String>
Description
website: Option<String>
Website url
picture: Option<String>
Picture url
Banner url
nip05: Option<String>
NIP05 (ex. name@example.com)
lud06: Option<String>
LNURL
lud16: Option<String>
Lightning Address
custom: BTreeMap<String, Value, Global>
Custom fields
Implementations§
source§impl Metadata
impl Metadata
sourcepub fn from_json<S>(json: S) -> Result<Metadata, Error>where
S: Into<String>,
pub fn from_json<S>(json: S) -> Result<Metadata, Error>where S: Into<String>,
Deserialize Metadata
from JSON
string
sourcepub fn display_name<S>(self, display_name: S) -> Metadatawhere
S: Into<String>,
pub fn display_name<S>(self, display_name: S) -> Metadatawhere S: Into<String>,
Set display_name
Set banner
Trait Implementations§
source§impl<'de> Deserialize<'de> for Metadata
impl<'de> Deserialize<'de> for Metadata
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Metadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Metadata, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<Metadata> for Metadata
impl PartialEq<Metadata> for Metadata
source§impl Serialize for Metadata
impl Serialize for Metadata
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Metadata
impl StructuralEq for Metadata
impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.