pub struct ConversionRequest {
pub exchange: Exchange,
pub trading_symbol: String,
pub transaction_type: TransactionType,
pub quantity: u32,
pub from_product: Product,
pub to_product: Product,
}
Expand description
Portfolio conversion request
Fields§
§exchange: Exchange
Exchange
trading_symbol: String
Trading symbol
transaction_type: TransactionType
Transaction type
quantity: u32
Quantity to convert
from_product: Product
From product type
to_product: Product
To product type
Implementations§
Source§impl ConversionRequest
impl ConversionRequest
Sourcepub fn new(
exchange: Exchange,
trading_symbol: String,
transaction_type: TransactionType,
quantity: u32,
from_product: Product,
to_product: Product,
) -> Self
pub fn new( exchange: Exchange, trading_symbol: String, transaction_type: TransactionType, quantity: u32, from_product: Product, to_product: Product, ) -> Self
Create a new conversion request
Sourcepub fn cnc_to_mis(
exchange: Exchange,
trading_symbol: String,
transaction_type: TransactionType,
quantity: u32,
) -> Self
pub fn cnc_to_mis( exchange: Exchange, trading_symbol: String, transaction_type: TransactionType, quantity: u32, ) -> Self
Create a request to convert CNC to MIS (position conversion)
Sourcepub fn mis_to_cnc(
exchange: Exchange,
trading_symbol: String,
transaction_type: TransactionType,
quantity: u32,
) -> Self
pub fn mis_to_cnc( exchange: Exchange, trading_symbol: String, transaction_type: TransactionType, quantity: u32, ) -> Self
Create a request to convert MIS to CNC (holding conversion)
Sourcepub fn nrml_to_mis(
exchange: Exchange,
trading_symbol: String,
transaction_type: TransactionType,
quantity: u32,
) -> Self
pub fn nrml_to_mis( exchange: Exchange, trading_symbol: String, transaction_type: TransactionType, quantity: u32, ) -> Self
Create a request to convert NRML to MIS
Sourcepub fn mis_to_nrml(
exchange: Exchange,
trading_symbol: String,
transaction_type: TransactionType,
quantity: u32,
) -> Self
pub fn mis_to_nrml( exchange: Exchange, trading_symbol: String, transaction_type: TransactionType, quantity: u32, ) -> Self
Create a request to convert MIS to NRML
Sourcepub fn conversion_type(&self) -> ConversionType
pub fn conversion_type(&self) -> ConversionType
Get the conversion type based on products
Sourcepub fn is_valid_conversion(&self) -> bool
pub fn is_valid_conversion(&self) -> bool
Check if this is a valid conversion
Trait Implementations§
Source§impl Clone for ConversionRequest
impl Clone for ConversionRequest
Source§fn clone(&self) -> ConversionRequest
fn clone(&self) -> ConversionRequest
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 ConversionRequest
impl Debug for ConversionRequest
Source§impl<'de> Deserialize<'de> for ConversionRequest
impl<'de> Deserialize<'de> for ConversionRequest
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 ConversionRequest
impl RefUnwindSafe for ConversionRequest
impl Send for ConversionRequest
impl Sync for ConversionRequest
impl Unpin for ConversionRequest
impl UnwindSafe for ConversionRequest
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