pub struct ValidInput { /* private fields */ }Expand description
Input which has been validated and is ready for processing. Controls which language to use, the month for which to generate the invoice, the items to be invoiced, the layout of the invoice, and an optional output path for the generated PDF file.
Implementations§
Source§impl ValidInput
impl ValidInput
Sourcepub fn builder() -> ValidInputBuilder
pub fn builder() -> ValidInputBuilder
Create an instance of ValidInput using the builder syntax
Source§impl ValidInput
impl ValidInput
Sourcepub fn language(&self) -> &Language
pub fn language(&self) -> &Language
The language to use for the invoice, used on labels, headers etc.
Defaults to English (Language::EN).
Sourcepub fn period(&self) -> &YearMonthAndFortnight
pub fn period(&self) -> &YearMonthAndFortnight
The period for which to generate the invoice, this affects the invoice number as well as the invoice date and due date.
Note: We use the period type with the highest granularity, so that we
always can convert it to a kind of period of more coarse granularity.
For example, if the period is YearMonthAndFortnight, we can always
convert it to YearAndMonth later in the flow if that matches the invoice
cadence.
Sourcepub fn items(&self) -> &InvoicedItems
pub fn items(&self) -> &InvoicedItems
The items to be invoiced, either services or expenses.
Sourcepub fn maybe_output_path(&self) -> &Option<PathBuf>
pub fn maybe_output_path(&self) -> &Option<PathBuf>
An optional override of where to save the output PDF file.
Sourcepub fn email(&self) -> &Option<DecryptedEmailSettings>
pub fn email(&self) -> &Option<DecryptedEmailSettings>
If set, the invoice will be sent via email after generation.
If set to true but email is not configured, an error will be thrown later.
Trait Implementations§
Source§impl Clone for ValidInput
impl Clone for ValidInput
Source§fn clone(&self) -> ValidInput
fn clone(&self) -> ValidInput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidInput
impl Debug for ValidInput
Source§impl Display for ValidInput
impl Display for ValidInput
Source§impl HasSample for ValidInput
impl HasSample for ValidInput
Auto Trait Implementations§
impl Freeze for ValidInput
impl RefUnwindSafe for ValidInput
impl Send for ValidInput
impl Sync for ValidInput
impl Unpin for ValidInput
impl UnsafeUnpin for ValidInput
impl UnwindSafe for ValidInput
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> OrderedContainer<T> for Twhere
T: Clone,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.