pub struct Profile {
pub id: u16,
pub flags: ProfileFlags,
pub last_updated: u32,
/* private fields */
}Expand description
Internal profile: a u16 interner handle, flags, and every string in one packed block.
A cached image path inside the image cache dir is held as its file name and rebuilt
on read, so SlimProfile and the DB still see the full path.
Fields§
§id: u16§flags: ProfileFlags§last_updated: u32Implementations§
Source§impl Profile
impl Profile
pub fn new() -> Self
pub fn name(&self) -> &str
pub fn display_name(&self) -> &str
pub fn avatar(&self) -> &str
pub fn about(&self) -> &str
pub fn nickname(&self) -> &str
pub fn lud06(&self) -> &str
pub fn lud16(&self) -> &str
pub fn nip05(&self) -> &str
pub fn website(&self) -> &str
pub fn status_title(&self) -> &str
pub fn status_purpose(&self) -> &str
pub fn status_url(&self) -> &str
NIP-30 tags from the status event, so :shortcode: in it renders.
pub fn avatar_cached(&self) -> Cow<'_, str>
pub fn has_avatar_cached(&self) -> bool
pub fn set_name(&mut self, v: &str)
pub fn set_display_name(&mut self, v: &str)
pub fn set_avatar(&mut self, v: &str)
pub fn set_about(&mut self, v: &str)
pub fn set_nickname(&mut self, v: &str)
pub fn set_lud06(&mut self, v: &str)
pub fn set_lud16(&mut self, v: &str)
pub fn set_nip05(&mut self, v: &str)
pub fn set_website(&mut self, v: &str)
pub fn set_status_title(&mut self, v: &str)
pub fn set_status_purpose(&mut self, v: &str)
pub fn set_status_url(&mut self, v: &str)
Sourcepub fn set_status(
&mut self,
title: &str,
purpose: &str,
url: &str,
tags: &[EmojiTag],
)
pub fn set_status( &mut self, title: &str, purpose: &str, url: &str, tags: &[EmojiTag], )
Every status part in one rebuild.
Sourcepub fn forget_imagery(&mut self) -> Vec<CachedImage>
pub fn forget_imagery(&mut self) -> Vec<CachedImage>
Drop the avatar and banner, URLs and cached copies alike; returns the copies to delete.
pub fn has_imagery(&self) -> bool
pub fn set_avatar_cached(&mut self, path: &str)
Sourcepub fn heap_bytes(&self) -> usize
pub fn heap_bytes(&self) -> usize
Heap bytes held by the packed strings.
Sourcepub fn from_metadata(&mut self, meta: Metadata) -> bool
pub fn from_metadata(&mut self, meta: Metadata) -> bool
Merge Nostr Metadata into this Profile. Returns true if any fields changed.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Profile
impl Freeze for Profile
impl Move for Profile
impl RefUnwindSafe for Profile
impl Send for Profile
impl Sync for Profile
impl Unpin for Profile
impl UnsafeUnpin for Profile
impl UnwindSafe for Profile
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,
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