pub struct SubaccountOwnedView(/* private fields */);Expand description
Self-contained, 'static owned view of a Subaccount message.
Wraps ::buffa::OwnedView<SubaccountView<'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 SubaccountView when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.
Implementations§
Source§impl SubaccountOwnedView
impl SubaccountOwnedView
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: &Subaccount) -> Result<Self, DecodeError>
pub fn from_owned(msg: &Subaccount) -> 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) -> &SubaccountView<'_>
pub fn view(&self) -> &SubaccountView<'_>
Borrow the full SubaccountView with its lifetime tied to &self.
Sourcepub fn to_owned_message(&self) -> Result<Subaccount, DecodeError>
pub fn to_owned_message(&self) -> Result<Subaccount, 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 role(&self) -> EnumValue<SubaccountRole>
pub fn role(&self) -> EnumValue<SubaccountRole>
Role of the current caller on this sub-account.
Field 2: role
Sourcepub fn color(&self) -> &str
pub fn color(&self) -> &str
Optional user-chosen color token for UI display. Tokens use lowercase letters, numbers, underscores, or hyphens.
Field 11: color
Sourcepub fn status(&self) -> &str
pub fn status(&self) -> &str
Current status of the sub-account, such as “active” or “disabled”.
Field 4: status
Sourcepub fn smart_account_address(&self) -> &str
pub fn smart_account_address(&self) -> &str
Smart Account EVM address backing this sub-account.
Field 5: smart_account_address
Sourcepub fn owner_username(&self) -> &str
pub fn owner_username(&self) -> &str
Owner (root account) public username, if set. Useful for shared views.
Field 6: owner_username
Sourcepub fn owner_avatar_url(&self) -> &str
pub fn owner_avatar_url(&self) -> &str
Owner (root account) avatar URL, if set.
Field 7: owner_avatar_url
Sourcepub fn owner_root_smart_account_address(&self) -> &str
pub fn owner_root_smart_account_address(&self) -> &str
Owner (root account) primary Smart Account address, when available. Allows clients to display a stable identity even when no username is set.
Field 8: owner_root_smart_account_address
Sourcepub fn subaccount_policy_id(&self) -> u64
pub fn subaccount_policy_id(&self) -> u64
Optional sub-account policy identifier (opaque ID). 0 means no explicit policy attached.
Field 9: subaccount_policy_id
Sourcepub fn require_member_mfa(&self) -> bool
pub fn require_member_mfa(&self) -> bool
Owner-controlled security baseline for delegated interactive members on protected sub-account actions. This does not apply to read-only real-time subscriptions.
Field 12: require_member_mfa
Sourcepub fn smart_account_salt_nonce(&self) -> Option<u32>
pub fn smart_account_salt_nonce(&self) -> Option<u32>
Smart-account derivation salt nonce assigned when this sub-account was created. Present only when the caller owns the sub-account and can use it for direct chain signing.
Field 13: smart_account_salt_nonce
Sourcepub fn updated_at(&self) -> &MessageFieldView<TimestampView<'_>>
pub fn updated_at(&self) -> &MessageFieldView<TimestampView<'_>>
Time in UTC when this sub-account’s configuration was last changed. For the same sub-account, later is fresher, equal is an idempotent replay, and earlier is stale. Equal timestamps with different configuration indicate an invariant failure.
Field 14: updated_at
Trait Implementations§
Source§impl AsRef<OwnedView<SubaccountView<'static>>> for SubaccountOwnedView
impl AsRef<OwnedView<SubaccountView<'static>>> for SubaccountOwnedView
Source§fn as_ref(&self) -> &OwnedView<SubaccountView<'static>>
fn as_ref(&self) -> &OwnedView<SubaccountView<'static>>
Source§impl Clone for SubaccountOwnedView
impl Clone for SubaccountOwnedView
Source§fn clone(&self) -> SubaccountOwnedView
fn clone(&self) -> SubaccountOwnedView
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more