pub struct DirectoryAppKey {
pub pk: DidNostr,
pub owner: DidNostr,
}Expand description
One listed application key: an enabled key and its active owner.
§Examples
use stratum_node_core::{DidNostr, DirectoryAppKey};
let pk = DidNostr::from_hex(&"c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5")?;
let owner = DidNostr::from_hex(&"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798")?;
let entry = DirectoryAppKey { pk, owner };
let text = serde_json::to_string(&entry)?;
assert_eq!(text, format!(r#"{{"pk":"{}","owner":"{}"}}"#, pk.to_hex(), owner.to_hex()));
assert_eq!(serde_json::from_str::<DirectoryAppKey>(&text)?, entry);Fields§
§pk: DidNostrThe application key.
owner: DidNostrThe member who owns the installation the key belongs to.
Trait Implementations§
Source§impl Clone for DirectoryAppKey
impl Clone for DirectoryAppKey
impl Copy for DirectoryAppKey
Source§impl Debug for DirectoryAppKey
impl Debug for DirectoryAppKey
Source§impl<'de> Deserialize<'de> for DirectoryAppKey
impl<'de> Deserialize<'de> for DirectoryAppKey
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
impl Eq for DirectoryAppKey
Source§impl Hash for DirectoryAppKey
impl Hash for DirectoryAppKey
Source§impl Ord for DirectoryAppKey
impl Ord for DirectoryAppKey
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for DirectoryAppKey
impl PartialEq for DirectoryAppKey
Source§impl PartialOrd for DirectoryAppKey
impl PartialOrd for DirectoryAppKey
Source§impl Serialize for DirectoryAppKey
impl Serialize for DirectoryAppKey
impl StructuralPartialEq for DirectoryAppKey
Auto Trait Implementations§
impl Forget for DirectoryAppKey
impl Freeze for DirectoryAppKey
impl Move for DirectoryAppKey
impl RefUnwindSafe for DirectoryAppKey
impl Send for DirectoryAppKey
impl Sync for DirectoryAppKey
impl Unpin for DirectoryAppKey
impl UnsafeUnpin for DirectoryAppKey
impl UnwindSafe for DirectoryAppKey
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