pub struct TargetAllocation {
pub symbol: String,
pub percent: Option<f64>,
pub notional: Option<String>,
}Expand description
Target allocation for rebalancing.
Fields§
§symbol: StringSymbol.
percent: Option<f64>Target percentage (0-100).
notional: Option<String>Target notional value.
Implementations§
Source§impl TargetAllocation
impl TargetAllocation
Sourcepub fn percent(symbol: &str, percent: f64) -> TargetAllocation
pub fn percent(symbol: &str, percent: f64) -> TargetAllocation
Create allocation by percentage.
Sourcepub fn notional(symbol: &str, notional: &str) -> TargetAllocation
pub fn notional(symbol: &str, notional: &str) -> TargetAllocation
Create allocation by notional value.
Trait Implementations§
Source§impl Clone for TargetAllocation
impl Clone for TargetAllocation
Source§fn clone(&self) -> TargetAllocation
fn clone(&self) -> TargetAllocation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TargetAllocation
impl Debug for TargetAllocation
Source§impl<'de> Deserialize<'de> for TargetAllocation
impl<'de> Deserialize<'de> for TargetAllocation
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TargetAllocation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TargetAllocation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for TargetAllocation
impl Serialize for TargetAllocation
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for TargetAllocation
impl RefUnwindSafe for TargetAllocation
impl Send for TargetAllocation
impl Sync for TargetAllocation
impl Unpin for TargetAllocation
impl UnwindSafe for TargetAllocation
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