pub struct UserProfileOwnedView(/* private fields */);Expand description
Self-contained, 'static owned view of a UserProfile message.
Wraps ::buffa::OwnedView<UserProfileView<'static>>: the decoded view and the ::buffa::bytes::Bytes buffer it borrows from travel together, so the handle is 'static and Send + Sync — suitable for async handlers, spawned tasks, and anywhere a 'static bound is required.
Field accessors return borrows tied to &self. Use Self::view to get the full UserProfileView when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.
Implementations§
Source§impl UserProfileOwnedView
impl UserProfileOwnedView
Sourcepub fn decode(bytes: Bytes) -> Result<Self, DecodeError>
pub fn decode(bytes: Bytes) -> Result<Self, DecodeError>
Decode an owned view from a ::buffa::bytes::Bytes buffer.
The view borrows directly from the buffer’s data; the buffer is retained inside the returned handle.
§Errors
Returns ::buffa::DecodeError if the buffer contains invalid
protobuf data.
Sourcepub fn decode_with_options(
bytes: Bytes,
opts: &DecodeOptions,
) -> Result<Self, DecodeError>
pub fn decode_with_options( bytes: Bytes, opts: &DecodeOptions, ) -> Result<Self, DecodeError>
Decode with custom ::buffa::DecodeOptions (recursion limit,
max message size).
§Errors
Returns ::buffa::DecodeError if the buffer is invalid or
exceeds the configured limits.
Sourcepub fn from_owned(msg: &UserProfile) -> Result<Self, DecodeError>
pub fn from_owned(msg: &UserProfile) -> Result<Self, DecodeError>
Build from an owned message via an encode → decode round-trip.
§Errors
Returns ::buffa::DecodeError if the re-encoded bytes are
somehow invalid (should not happen for well-formed messages).
Sourcepub fn view(&self) -> &UserProfileView<'_>
pub fn view(&self) -> &UserProfileView<'_>
Borrow the full UserProfileView with its lifetime tied to &self.
Sourcepub fn to_owned_message(&self) -> Result<UserProfile, DecodeError>
pub fn to_owned_message(&self) -> Result<UserProfile, DecodeError>
Convert to the owned message type.
§Errors
Returns an error if re-materializing preserved unknown fields fails (e.g. the unknown-field limit is exceeded).
Sourcepub fn into_bytes(self) -> Bytes
pub fn into_bytes(self) -> Bytes
Consume the handle, returning the underlying bytes buffer.
Sourcepub fn username(&self) -> &str
pub fn username(&self) -> &str
Public username for the root account. Usernames are unique case-insensitively and use 3 to 32 letters, digits, underscores, dots, or hyphens. Empty means no username is set.
Field 1: username
Sourcepub fn website(&self) -> &str
pub fn website(&self) -> &str
Public website URL, if set. Maximum length is 256 characters.
Field 3: website
Sourcepub fn twitter(&self) -> &str
pub fn twitter(&self) -> &str
X/Twitter handle without “@”. Maximum length is 15 characters.
Field 4: twitter
Sourcepub fn twitter_verified(&self) -> bool
pub fn twitter_verified(&self) -> bool
Whether the X/Twitter handle for this account has been verified.
Field 8: twitter_verified
Sourcepub fn discord(&self) -> &str
pub fn discord(&self) -> &str
Discord handle or username without “@”. Maximum length is 64 characters.
Field 9: discord
Sourcepub fn discord_verified(&self) -> bool
pub fn discord_verified(&self) -> bool
Whether the Discord handle for this account has been verified.
Field 10: discord_verified
Sourcepub fn avatar_url(&self) -> &str
pub fn avatar_url(&self) -> &str
Avatar URL, if set. Maximum length is 256 characters.
Field 5: avatar_url
Sourcepub fn created_at(&self) -> &MessageFieldView<TimestampView<'_>>
pub fn created_at(&self) -> &MessageFieldView<TimestampView<'_>>
Account creation time in UTC. This is the canonical “member since” timestamp.
Field 12: created_at
Sourcepub fn next_username_change_at(&self) -> &MessageFieldView<TimestampView<'_>>
pub fn next_username_change_at(&self) -> &MessageFieldView<TimestampView<'_>>
Next time in UTC when the username can be changed again. Omitted when no cooldown applies.
Field 6: next_username_change_at
Sourcepub fn vip_tier(&self) -> i32
pub fn vip_tier(&self) -> i32
Current VIP tier for this root account. A value of 0 is the base tier. Read-only.
Field 7: vip_tier
Sourcepub fn username_unlocked(&self) -> bool
pub fn username_unlocked(&self) -> bool
Whether this account is currently allowed to claim/change a username.
Field 11: username_unlocked
Trait Implementations§
Source§impl AsRef<OwnedView<UserProfileView<'static>>> for UserProfileOwnedView
impl AsRef<OwnedView<UserProfileView<'static>>> for UserProfileOwnedView
Source§fn as_ref(&self) -> &OwnedView<UserProfileView<'static>>
fn as_ref(&self) -> &OwnedView<UserProfileView<'static>>
Source§impl Clone for UserProfileOwnedView
impl Clone for UserProfileOwnedView
Source§fn clone(&self) -> UserProfileOwnedView
fn clone(&self) -> UserProfileOwnedView
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more