user info serialisable

new-idea
Avril 4 years ago
parent d72a52a988
commit 3b9ffd8ead
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -12,7 +12,7 @@ use post::Post;
id_type!(UserID; "A unique user iD"); id_type!(UserID; "A unique user iD");
/// The salt added to to the user ID hash to be signed by the user's private key. /// The salt added to to the user ID hash to be signed by the user's private key.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
pub struct UserSalt([u8; 16]); pub struct UserSalt([u8; 16]);
impl UserSalt impl UserSalt
@ -48,7 +48,7 @@ impl UserID
/// A user identifier. /// A user identifier.
/// ///
/// Contains the user's unique ID, their public key(s), and a valid signature of the sha256 hash of the user's ID + a random salt. /// Contains the user's unique ID, their public key(s), and a valid signature of the sha256 hash of the user's ID + a random salt.
#[derive(Debug, PartialEq, Eq, Hash)] #[derive(Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct User pub struct User
{ {
/// The user's unique ID. /// The user's unique ID.

Loading…
Cancel
Save