[−][src]Struct asciii::project::Project
Represents a Project.
A project is storable, contains products, and you can create an offer or invoice from it.
The main implementation is done in spec
.
Methods
impl Project
[src]
impl Project
pub fn yaml(&self) -> &Yaml
[src]
pub fn yaml(&self) -> &Yaml
Access to inner data
pub fn open<S: AsRef<OsStr> + ?Sized>(pathish: &S) -> Result<Project>
[src]
pub fn open<S: AsRef<OsStr> + ?Sized>(pathish: &S) -> Result<Project>
Opens a project from file path;
pub fn parse_yaml(&self) -> Result<Project>
[src]
pub fn parse_yaml(&self) -> Result<Project>
import from yaml file
pub fn dump_yaml(&self) -> String
[src]
pub fn dump_yaml(&self) -> String
pub fn to_json(&self) -> Result<String>
[src]
pub fn to_json(&self) -> Result<String>
export to JSON
pub fn from_file_content(content: &str) -> Result<Project>
[src]
pub fn from_file_content(content: &str) -> Result<Project>
Used mostly for testing purposes
pub fn field(&self, path: &str) -> Option<String>
[src]
pub fn field(&self, path: &str) -> Option<String>
wrapper around yaml::get() with replacement
pub fn client(&self) -> Client
[src]
pub fn client(&self) -> Client
Returns the struct Client
, which abstracts away client specific stuff.
pub fn offer(&self) -> Offer
[src]
pub fn offer(&self) -> Offer
Returns the struct Offer
, which abstracts away offer specific stuff.
pub fn invoice(&self) -> Invoice
[src]
pub fn invoice(&self) -> Invoice
Returns the struct Invoice
, which abstracts away invoice specific stuff.
pub fn hours(&self) -> Hours
[src]
pub fn hours(&self) -> Hours
Returns the struct Invoice
, which abstracts away invoice specific stuff.
pub fn is_ready_for_offer(&self) -> SpecResult
[src]
pub fn is_ready_for_offer(&self) -> SpecResult
Ready to produce offer.
Ready to send an offer to the client.
pub fn is_ready_for_invoice(&self) -> SpecResult
[src]
pub fn is_ready_for_invoice(&self) -> SpecResult
Valid to produce invoice
Ready to send an invoice to the client.
pub fn is_ready_for_archive(&self) -> SpecResult
[src]
pub fn is_ready_for_archive(&self) -> SpecResult
Completely done and in the past.
Ready to be **h:
pub fn to_csv(&self, bill_type: BillType) -> Result<String>
[src]
pub fn to_csv(&self, bill_type: BillType) -> Result<String>
pub fn debug(&self) -> Debug
[src]
pub fn debug(&self) -> Debug
pub fn empty_fields(&self) -> Vec<String>
[src]
pub fn empty_fields(&self) -> Vec<String>
Check Templated for replacable markers
pub fn replace_field(&self, field: &str, value: &str) -> Result<()>
[src]
pub fn replace_field(&self, field: &str, value: &str) -> Result<()>
Fill certain field
pub fn our_bad(&self) -> Option<Duration>
[src]
pub fn our_bad(&self) -> Option<Duration>
Time between event and creation of invoice
pub fn their_bad(&self) -> Option<Duration>
[src]
pub fn their_bad(&self) -> Option<Duration>
Time between creation of invoice and payment
pub fn to_tasks(&self) -> Calendar
[src]
pub fn to_tasks(&self) -> Calendar
What I need to do
Produces an iCal calendar from this project.
Trait Implementations
impl Validatable for Project
[src]
impl Validatable for Project
fn validate(&self) -> SpecResult
[src]
fn validate(&self) -> SpecResult
Checks for certain errors
fn is_valid(&self) -> bool
[src]
fn is_valid(&self) -> bool
Returns true if valid
fn errors(&self) -> Option<ErrorList>
[src]
fn errors(&self) -> Option<ErrorList>
Returns list of found errors
impl IsProject for Project
[src]
impl IsProject for Project
fn name(&self) -> Option<&str>
[src]
fn name(&self) -> Option<&str>
Project Name
fn event_date(&self) -> Option<Date<Utc>>
[src]
fn event_date(&self) -> Option<Date<Utc>>
When was the event
fn format(&self) -> Option<Version>
[src]
fn format(&self) -> Option<Version>
Version of project format
fn canceled(&self) -> bool
[src]
fn canceled(&self) -> bool
Did the event actually occur
fn responsible(&self) -> Option<&str>
[src]
fn responsible(&self) -> Option<&str>
Who organized the event
fn long_desc(&self) -> String
[src]
fn long_desc(&self) -> String
Long description of the project
impl Redeemable for Project
[src]
impl Redeemable for Project
fn payed_date(&self) -> Option<Date<Utc>>
[src]
fn payed_date(&self) -> Option<Date<Utc>>
When was the project payed
fn is_payed(&self) -> bool
[src]
fn is_payed(&self) -> bool
If was the project payed
fn tax(&self) -> Option<Tax>
[src]
fn tax(&self) -> Option<Tax>
When what is the MWsT of the project.
fn bills(&self) -> ProductResult<(Bill<Product>, Bill<Product>)>
[src]
fn bills(&self) -> ProductResult<(Bill<Product>, Bill<Product>)>
Returns a bill for the offer and one for the invoice.
fn sum_sold(&self) -> ProductResult<Currency>
[src]
fn sum_sold(&self) -> ProductResult<Currency>
Sum of sold products
impl HasEvents for Project
[src]
impl HasEvents for Project
fn to_ical(&self) -> Calendar
[src]
fn to_ical(&self) -> Calendar
Produces an iCal calendar from this project.
fn events(&self) -> Option<Vec<Event>>
[src]
fn events(&self) -> Option<Vec<Event>>
Produces a list of DateRange
s for the event.
fn times(&self, yaml: &Yaml) -> Option<Vec<EventTime>>
[src]
fn times(&self, yaml: &Yaml) -> Option<Vec<EventTime>>
Returns a list of Event
s
fn location(&self) -> Option<&str>
[src]
fn location(&self) -> Option<&str>
Returns the location of the event
impl ExportTarget<Client> for Project
[src]
impl ExportTarget<Client> for Project
impl ExportTarget<Event> for Project
[src]
impl ExportTarget<Event> for Project
impl ExportTarget<Service> for Project
[src]
impl ExportTarget<Service> for Project
impl ExportTarget<Offer> for Project
[src]
impl ExportTarget<Offer> for Project
impl ExportTarget<Invoice> for Project
[src]
impl ExportTarget<Invoice> for Project
impl ExportTarget<Bills> for Project
[src]
impl ExportTarget<Bills> for Project
impl ExportTarget<Complete> for Project
[src]
impl ExportTarget<Complete> for Project
impl ExportTarget<Checks> for Project
[src]
impl ExportTarget<Checks> for Project
impl ExportTarget<Errors> for Project
[src]
impl ExportTarget<Errors> for Project
impl ExportTarget<Extras> for Project
[src]
impl ExportTarget<Extras> for Project
impl Exportable for Project
[src]
impl Exportable for Project
fn export_dir(&self) -> PathBuf
[src]
fn export_dir(&self) -> PathBuf
Where to export to
fn offer_file_name(&self, extension: &str) -> Option<String>
[src]
fn offer_file_name(&self, extension: &str) -> Option<String>
Filename of the offer output file.
fn invoice_file_name(&self, extension: &str) -> Option<String>
[src]
fn invoice_file_name(&self, extension: &str) -> Option<String>
Filename of the invoice output file. Carefull! uses today's date.
fn output_file_exists(&self, bill_type: &BillType) -> bool
[src]
fn output_file_exists(&self, bill_type: &BillType) -> bool
fn output_file(&self, bill_type: &BillType) -> Option<PathBuf>
[src]
fn output_file(&self, bill_type: &BillType) -> Option<PathBuf>
fn offer_file(&self) -> Option<PathBuf>
[src]
fn offer_file(&self) -> Option<PathBuf>
fn invoice_file(&self) -> Option<PathBuf>
[src]
fn invoice_file(&self) -> Option<PathBuf>
fn offer_file_exists(&self) -> bool
[src]
fn offer_file_exists(&self) -> bool
fn invoice_file_exists(&self) -> bool
[src]
fn invoice_file_exists(&self) -> bool
fn write_to_path<P: AsRef<OsStr> + Debug>(
content: &str,
target: &P
) -> Result<()>
[src]
fn write_to_path<P: AsRef<OsStr> + Debug>(
content: &str,
target: &P
) -> Result<()>
fn full_file_path(&self, bill_type: &BillType, ext: &str) -> Result<PathBuf>
[src]
fn full_file_path(&self, bill_type: &BillType, ext: &str) -> Result<PathBuf>
fn full_offer_file_path(&self, ext: &str) -> Result<PathBuf>
[src]
fn full_offer_file_path(&self, ext: &str) -> Result<PathBuf>
fn full_invoice_file_path(&self, ext: &str) -> Result<PathBuf>
[src]
fn full_invoice_file_path(&self, ext: &str) -> Result<PathBuf>
fn write_to_file(
&self,
content: &str,
bill_type: &BillType,
ext: &str
) -> Result<PathBuf>
[src]
fn write_to_file(
&self,
content: &str,
bill_type: &BillType,
ext: &str
) -> Result<PathBuf>
fn write_to_offer_file(&self, content: &str, ext: &str) -> Result<PathBuf>
[src]
fn write_to_offer_file(&self, content: &str, ext: &str) -> Result<PathBuf>
fn write_to_invoice_file(&self, content: &str, ext: &str) -> Result<PathBuf>
[src]
fn write_to_invoice_file(&self, content: &str, ext: &str) -> Result<PathBuf>
impl Storable for Project
[src]
impl Storable for Project
fn file_extension() -> String
[src]
fn file_extension() -> String
Main Projectfile extension
fn from_template(
project_name: &str,
template: &Path,
fill: &HashMap<&str, String>
) -> StorageResult<StorableAndTempDir<Self>>
[src]
fn from_template(
project_name: &str,
template: &Path,
fill: &HashMap<&str, String>
) -> StorageResult<StorableAndTempDir<Self>>
creates in tempfile
fn prefix(&self) -> Option<String>
[src]
fn prefix(&self) -> Option<String>
For archiving
fn index(&self) -> Option<String>
[src]
fn index(&self) -> Option<String>
For sorting
fn short_desc(&self) -> String
[src]
fn short_desc(&self) -> String
fn modified_date(&self) -> Option<Date<Utc>>
[src]
fn modified_date(&self) -> Option<Date<Utc>>
fn file(&self) -> PathBuf
[src]
fn file(&self) -> PathBuf
Path to project file
fn set_file(&mut self, new_file: &Path)
[src]
fn set_file(&mut self, new_file: &Path)
Sets the project File
fn set_git_status(&mut self, status: GitStatus)
[src]
fn set_git_status(&mut self, status: GitStatus)
Tell a project its own git status after opening Read more
fn get_git_status(&self) -> GitStatus
[src]
fn get_git_status(&self) -> GitStatus
Ask a project for its gitstatus
fn open_folder(folder_path: &Path) -> StorageResult<Project>
[src]
fn open_folder(folder_path: &Path) -> StorageResult<Project>
Opens a yaml and parses it.
fn open_file(file_path: &Path) -> StorageResult<Project>
[src]
fn open_file(file_path: &Path) -> StorageResult<Project>
fn matches_filter(&self, key: &str, val: &str) -> bool
[src]
fn matches_filter(&self, key: &str, val: &str) -> bool
Checks against a certain key-val pair.
fn matches_search(&self, term: &str) -> bool
[src]
fn matches_search(&self, term: &str) -> bool
UNIMPLEMENTED: Checks against a certain search term.
TODO compare agains InvoiceNumber, ClientFullName, Email, event/name, invoice/official Etc
fn is_ready_for_archive(&self) -> bool
[src]
fn is_ready_for_archive(&self) -> bool
fn ident(&self) -> String
[src]
fn ident(&self) -> String
For file names
fn year(&self) -> Option<i32>
[src]
fn year(&self) -> Option<i32>
fn delete_project_dir_if(
&self,
confirmed: impl Fn() -> bool
) -> Result<()>
[src]
fn delete_project_dir_if(
&self,
confirmed: impl Fn() -> bool
) -> Result<()>
Deletes the project if the passed in closure returns true
fn file_name(&self) -> String
[src]
fn file_name(&self) -> String
Filename as fallback
fn dir(&self) -> FolderPathBuf
[src]
fn dir(&self) -> FolderPathBuf
Path to project folder
impl<'a> From<&'a Project> for Debug
[src]
impl<'a> From<&'a Project> for Debug
impl Clone for Project
[src]
impl Clone for Project
fn clone(&self) -> Project
[src]
fn clone(&self) -> Project
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Project
[src]
impl Debug for Project
Auto Trait Implementations
Blanket Implementations
impl<T> IsProjectExt for T where
T: Storable,
[src]
impl<T> IsProjectExt for T where
T: Storable,
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more