pub struct UserResponse {Show 15 fields
pub user_request_id: String,
pub username: String,
pub user_status: UserStatus,
pub user_status_text: Option<String>,
pub raw_data_length: Option<i32>,
pub raw_data: Option<Vec<u8>>,
pub deribit_label: Option<String>,
pub user_equity: Option<f64>,
pub user_balance: Option<f64>,
pub user_initial_margin: Option<f64>,
pub user_maintenance_margin: Option<f64>,
pub unrealized_pl: Option<f64>,
pub realized_pl: Option<f64>,
pub total_pl: Option<f64>,
pub margin_balance: Option<f64>,
}Expand description
User Response message (MsgType = ‘BF’)
Fields§
§user_request_id: StringUser request ID
username: StringUsername
user_status: UserStatusUser status
user_status_text: Option<String>User status text
raw_data_length: Option<i32>Raw data length
raw_data: Option<Vec<u8>>Raw data
deribit_label: Option<String>Custom label
user_equity: Option<f64>User equity (tag 100001)
user_balance: Option<f64>User balance (tag 100002)
user_initial_margin: Option<f64>User initial margin (tag 100003)
user_maintenance_margin: Option<f64>User maintenance margin (tag 100004)
unrealized_pl: Option<f64>Unrealized P/L (tag 100005)
realized_pl: Option<f64>Realized P/L (tag 100006)
total_pl: Option<f64>Total P/L (tag 100011)
margin_balance: Option<f64>Margin balance for cross collateral (tag 100013)
Implementations§
Source§impl UserResponse
impl UserResponse
Sourcepub fn new(
user_request_id: String,
username: String,
user_status: UserStatus,
) -> Self
pub fn new( user_request_id: String, username: String, user_status: UserStatus, ) -> Self
Create a new user response
Sourcepub fn logged_in(user_request_id: String, username: String) -> Self
pub fn logged_in(user_request_id: String, username: String) -> Self
Create a successful login response
Sourcepub fn logged_out(user_request_id: String, username: String) -> Self
pub fn logged_out(user_request_id: String, username: String) -> Self
Create a successful logout response
Sourcepub fn password_changed(user_request_id: String, username: String) -> Self
pub fn password_changed(user_request_id: String, username: String) -> Self
Create a password changed response
Sourcepub fn user_not_recognised(user_request_id: String, username: String) -> Self
pub fn user_not_recognised(user_request_id: String, username: String) -> Self
Create an error response for unrecognized user
Sourcepub fn password_incorrect(user_request_id: String, username: String) -> Self
pub fn password_incorrect(user_request_id: String, username: String) -> Self
Create an error response for incorrect password
Sourcepub fn error(
user_request_id: String,
username: String,
error_text: String,
) -> Self
pub fn error( user_request_id: String, username: String, error_text: String, ) -> Self
Create a generic error response
Sourcepub fn with_user_status_text(self, user_status_text: String) -> Self
pub fn with_user_status_text(self, user_status_text: String) -> Self
Set user status text
Sourcepub fn with_raw_data(self, raw_data: Vec<u8>) -> Self
pub fn with_raw_data(self, raw_data: Vec<u8>) -> Self
Set raw data
Sourcepub fn with_label(self, label: String) -> Self
pub fn with_label(self, label: String) -> Self
Set custom label
Sourcepub fn with_user_equity(self, equity: f64) -> Self
pub fn with_user_equity(self, equity: f64) -> Self
Set user equity (tag 100001)
Sourcepub fn with_user_balance(self, balance: f64) -> Self
pub fn with_user_balance(self, balance: f64) -> Self
Set user balance (tag 100002)
Sourcepub fn with_user_initial_margin(self, initial_margin: f64) -> Self
pub fn with_user_initial_margin(self, initial_margin: f64) -> Self
Set user initial margin (tag 100003)
Sourcepub fn with_user_maintenance_margin(self, maintenance_margin: f64) -> Self
pub fn with_user_maintenance_margin(self, maintenance_margin: f64) -> Self
Set user maintenance margin (tag 100004)
Sourcepub fn with_unrealized_pl(self, unrealized_pl: f64) -> Self
pub fn with_unrealized_pl(self, unrealized_pl: f64) -> Self
Set unrealized P/L (tag 100005)
Sourcepub fn with_realized_pl(self, realized_pl: f64) -> Self
pub fn with_realized_pl(self, realized_pl: f64) -> Self
Set realized P/L (tag 100006)
Sourcepub fn with_total_pl(self, total_pl: f64) -> Self
pub fn with_total_pl(self, total_pl: f64) -> Self
Set total P/L (tag 100011)
Sourcepub fn with_margin_balance(self, margin_balance: f64) -> Self
pub fn with_margin_balance(self, margin_balance: f64) -> Self
Set margin balance for cross collateral (tag 100013)
Sourcepub fn to_fix_message(
&self,
sender_comp_id: &str,
target_comp_id: &str,
msg_seq_num: u32,
) -> DeribitFixResult<String>
pub fn to_fix_message( &self, sender_comp_id: &str, target_comp_id: &str, msg_seq_num: u32, ) -> DeribitFixResult<String>
Convert to FIX message
Trait Implementations§
Source§impl Clone for UserResponse
impl Clone for UserResponse
Source§fn clone(&self) -> UserResponse
fn clone(&self) -> UserResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UserResponse
impl Debug for UserResponse
Source§impl<'de> Deserialize<'de> for UserResponse
impl<'de> Deserialize<'de> for UserResponse
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>,
Source§impl Display for UserResponse
impl Display for UserResponse
Source§impl PartialEq for UserResponse
impl PartialEq for UserResponse
Source§impl Serialize for UserResponse
impl Serialize for UserResponse
impl StructuralPartialEq for UserResponse
Auto Trait Implementations§
impl Freeze for UserResponse
impl RefUnwindSafe for UserResponse
impl Send for UserResponse
impl Sync for UserResponse
impl Unpin for UserResponse
impl UnsafeUnpin for UserResponse
impl UnwindSafe for UserResponse
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
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.