Struct AssetWeight
pub struct AssetWeight { /* private fields */ }Expand description
A non-empty asset identifier paired with a portfolio weight.
Implementations§
§impl AssetWeight
impl AssetWeight
pub fn new(
asset_id: impl AsRef<str>,
weight: PortfolioWeight,
) -> Result<AssetWeight, PortfolioWeightError>
pub fn new( asset_id: impl AsRef<str>, weight: PortfolioWeight, ) -> Result<AssetWeight, PortfolioWeightError>
Creates an asset weight.
§Errors
Returns [PortfolioWeightError::EmptyAssetId] when the trimmed identifier is empty.
pub const fn weight(&self) -> PortfolioWeight
pub const fn weight(&self) -> PortfolioWeight
Returns the asset weight.
Trait Implementations§
§impl Clone for AssetWeight
impl Clone for AssetWeight
§fn clone(&self) -> AssetWeight
fn clone(&self) -> AssetWeight
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 more§impl Debug for AssetWeight
impl Debug for AssetWeight
§impl PartialEq for AssetWeight
impl PartialEq for AssetWeight
impl StructuralPartialEq for AssetWeight
Auto Trait Implementations§
impl Freeze for AssetWeight
impl RefUnwindSafe for AssetWeight
impl Send for AssetWeight
impl Sync for AssetWeight
impl Unpin for AssetWeight
impl UnsafeUnpin for AssetWeight
impl UnwindSafe for AssetWeight
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