Struct BondBasket
pub struct BondBasket {
pub constituents: Vec<BasketConstituent>,
}Expand description
A basket of bonds a total return swap returns, replicated from its constituents: the swap’s return leg is the weighted sum of each bond’s price return and pass-through flows, and its funding is on the weighted starting price. A single bond is the basket of one.
Fields§
§constituents: Vec<BasketConstituent>The constituents, in one currency, each with a positive weight.
Implementations§
§impl BondBasket
impl BondBasket
pub fn new(constituents: Vec<BasketConstituent>) -> Result<Self, FinancingError>
pub fn new(constituents: Vec<BasketConstituent>) -> Result<Self, FinancingError>
A basket from its constituents.
§Errors
FinancingError::EmptyBasket with no constituents;
FinancingError::NonPositiveWeight for a weight that is not finite
and strictly positive; FinancingError::MixedCurrencies when a
constituent’s currency differs from the first’s.
pub fn single(bond: FixedRateBond, initial_price: f64) -> Self
pub fn single(bond: FixedRateBond, initial_price: f64) -> Self
The basket of one: bond at weight one, starting at initial_price.
pub fn funded_per_100(&self) -> f64
pub fn funded_per_100(&self) -> f64
The weighted starting price per 100 of package notional: what the funding leg accrues on, per 100 face.
Trait Implementations§
§impl Clone for BondBasket
impl Clone for BondBasket
§fn clone(&self) -> BondBasket
fn clone(&self) -> BondBasket
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BondBasket
impl Debug for BondBasket
§impl PartialEq for BondBasket
impl PartialEq for BondBasket
impl StructuralPartialEq for BondBasket
Auto Trait Implementations§
impl !RefUnwindSafe for BondBasket
impl !UnwindSafe for BondBasket
impl Freeze for BondBasket
impl Send for BondBasket
impl Sync for BondBasket
impl Unpin for BondBasket
impl UnsafeUnpin for BondBasket
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