pub struct SlimProfile {Show 18 fields
pub id: String,
pub name: String,
pub display_name: String,
pub nickname: String,
pub lud06: String,
pub lud16: String,
pub banner: String,
pub avatar: String,
pub about: String,
pub website: String,
pub nip05: String,
pub status: Status,
pub last_updated: u64,
pub mine: bool,
pub bot: bool,
pub is_blocked: bool,
pub avatar_cached: String,
pub banner_cached: String,
}Expand description
Profile with npub string instead of interner handle. Used for:
- Sending to frontend (JSON serializable)
- Persisting to database
- IPC between processes
Fields§
§id: String§name: String§display_name: String§nickname: String§lud06: String§lud16: String§avatar: String§about: String§website: String§nip05: String§status: Status§last_updated: u64§mine: bool§bot: bool§is_blocked: bool§avatar_cached: StringImplementations§
Source§impl SlimProfile
impl SlimProfile
Sourcepub fn from_profile(profile: &Profile, interner: &NpubInterner) -> Self
pub fn from_profile(profile: &Profile, interner: &NpubInterner) -> Self
Convert from internal Profile, resolving interner handle to npub.
Sourcepub fn to_profile(&self) -> Profile
pub fn to_profile(&self) -> Profile
Convert to internal Profile (for loading from DB).
Trait Implementations§
Source§impl Clone for SlimProfile
impl Clone for SlimProfile
Source§fn clone(&self) -> SlimProfile
fn clone(&self) -> SlimProfile
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 SlimProfile
impl Debug for SlimProfile
Source§impl Default for SlimProfile
impl Default for SlimProfile
Source§fn default() -> SlimProfile
fn default() -> SlimProfile
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SlimProfile
impl<'de> Deserialize<'de> for SlimProfile
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 PartialEq for SlimProfile
impl PartialEq for SlimProfile
Source§impl Serialize for SlimProfile
impl Serialize for SlimProfile
impl StructuralPartialEq for SlimProfile
Auto Trait Implementations§
impl Freeze for SlimProfile
impl RefUnwindSafe for SlimProfile
impl Send for SlimProfile
impl Sync for SlimProfile
impl Unpin for SlimProfile
impl UnsafeUnpin for SlimProfile
impl UnwindSafe for SlimProfile
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more