Skip to main content

SimpleCashFlow

Struct SimpleCashFlow 

Source
pub struct SimpleCashFlow { /* private fields */ }
Expand description

A payment of a predetermined amount on a given date.

Implementations§

Source§

impl SimpleCashFlow

Source

pub fn new(amount: Real, date: Date) -> QlResult<Self>

Creates a flow paying amount on date.

Both guards are QuantLib’s, verbatim, from the SimpleCashFlow constructor body (simplecashflow.cpp:29 and :31), error strings included. They were omitted when this type was first ported.

§Errors

Errors if date is the null date or amount is the null Real.

Trait Implementations§

Source§

impl AsObservable for SimpleCashFlow

Source§

fn observable(&self) -> &Observable

Access to the embedded observable for registering observers.
Source§

impl CashFlow for SimpleCashFlow

Source§

fn amount(&self) -> QlResult<Real>

The amount paid at date, undiscounted.
Source§

fn ex_coupon_date(&self) -> Option<Date>

The date from which the flow trades ex-coupon, when it has one. Read more
Source§

fn as_coupon(&self) -> Option<&dyn Coupon>

The Coupon view of this flow, when it is one. Read more
Source§

fn trading_ex_coupon( &self, settings: &Settings<Date>, ref_date: Option<Date>, ) -> QlResult<bool>

Whether the flow trades ex-coupon as of ref_date (the evaluation date when None).
Source§

impl Event for SimpleCashFlow

Source§

fn date(&self) -> Date

The date at which the event occurs.
Source§

fn has_occurred( &self, settings: &Settings<Date>, ref_date: Option<Date>, include_ref_date: Option<bool>, ) -> QlResult<bool>

Whether the event has already occurred as of ref_date. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.