pub trait TierWriter: TierReader {
// Required methods
fn save_user_tier_sync(&self, update: &UserTierUpdate) -> Result<()>;
fn set_margin_mode_sync(
&self,
wallet: &WalletAddress,
margin_mode: MarginMode,
) -> Result<i64>;
fn insert_margin_mode_if_missing_sync(
&self,
wallet: &WalletAddress,
margin_mode: MarginMode,
) -> Result<Option<i64>>;
fn delete_user_tier_sync(&self, wallet: &WalletAddress) -> Result<()>;
}Expand description
Tier mutations.
Required Methods§
Sourcefn save_user_tier_sync(&self, update: &UserTierUpdate) -> Result<()>
fn save_user_tier_sync(&self, update: &UserTierUpdate) -> Result<()>
Upsert a tier. None fields in UserTierUpdate are left unchanged in the DB.
Sourcefn set_margin_mode_sync(
&self,
wallet: &WalletAddress,
margin_mode: MarginMode,
) -> Result<i64>
fn set_margin_mode_sync( &self, wallet: &WalletAddress, margin_mode: MarginMode, ) -> Result<i64>
Set margin mode for a wallet. Returns the new version counter.
Sourcefn insert_margin_mode_if_missing_sync(
&self,
wallet: &WalletAddress,
margin_mode: MarginMode,
) -> Result<Option<i64>>
fn insert_margin_mode_if_missing_sync( &self, wallet: &WalletAddress, margin_mode: MarginMode, ) -> Result<Option<i64>>
Insert a tier row with margin mode only if one doesn’t exist. Returns the new version counter, or None if the row already existed.
Sourcefn delete_user_tier_sync(&self, wallet: &WalletAddress) -> Result<()>
fn delete_user_tier_sync(&self, wallet: &WalletAddress) -> Result<()>
Delete the tier row for a wallet.