pub struct AssetWeight { /* private fields */ }Expand description
A non-empty asset identifier paired with a portfolio weight.
Implementations§
Source§impl AssetWeight
impl AssetWeight
Sourcepub fn new(
asset_id: impl AsRef<str>,
weight: PortfolioWeight,
) -> Result<Self, PortfolioWeightError>
pub fn new( asset_id: impl AsRef<str>, weight: PortfolioWeight, ) -> Result<Self, PortfolioWeightError>
Creates an asset weight.
§Errors
Returns PortfolioWeightError::EmptyAssetId when the trimmed identifier is empty.
Sourcepub const fn weight(&self) -> PortfolioWeight
pub const fn weight(&self) -> PortfolioWeight
Returns the asset weight.
Trait Implementations§
Source§impl Clone for AssetWeight
impl Clone for AssetWeight
Source§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 moreSource§impl Debug for AssetWeight
impl Debug for AssetWeight
Source§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