pub struct UserProfile {
pub user_id: String,
pub user_name: String,
pub user_shortname: String,
pub user_type: String,
pub email: String,
pub avatar_url: Option<String>,
pub broker: String,
pub exchanges: Vec<String>,
pub products: Vec<String>,
pub order_types: Vec<String>,
pub meta: Option<UserMeta>,
}
Expand description
User profile information from the profile
API
Fields§
§user_id: String
User ID
user_name: String
User name/display name
user_shortname: String
User short name
user_type: String
User type (“individual”, “corporate”, etc.)
email: String
Email address
avatar_url: Option<String>
Avatar URL
broker: String
Broker identifier
exchanges: Vec<String>
List of enabled exchanges
products: Vec<String>
List of enabled products
order_types: Vec<String>
List of enabled order types
meta: Option<UserMeta>
User metadata
Implementations§
Source§impl UserProfile
impl UserProfile
Sourcepub fn has_exchange(&self, exchange: &str) -> bool
pub fn has_exchange(&self, exchange: &str) -> bool
Check if user has access to a specific exchange
Sourcepub fn has_product(&self, product: &str) -> bool
pub fn has_product(&self, product: &str) -> bool
Check if user has access to a specific product
Sourcepub fn has_order_type(&self, order_type: &str) -> bool
pub fn has_order_type(&self, order_type: &str) -> bool
Check if user has access to a specific order type
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
Get display name (prefer user_name, fallback to user_shortname)
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if profile has essential information
Trait Implementations§
Source§impl Clone for UserProfile
impl Clone for UserProfile
Source§fn clone(&self) -> UserProfile
fn clone(&self) -> UserProfile
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for UserProfile
impl Debug for UserProfile
Source§impl<'de> Deserialize<'de> for UserProfile
impl<'de> Deserialize<'de> for UserProfile
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
Auto Trait Implementations§
impl Freeze for UserProfile
impl RefUnwindSafe for UserProfile
impl Send for UserProfile
impl Sync for UserProfile
impl Unpin for UserProfile
impl UnwindSafe for UserProfile
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