pub struct Env<'a> {
pub config: &'a Config,
pub paths: &'a StorePaths,
pub window: TimeWindow,
pub project: Option<&'a str>,
pub json: bool,
pub no_ingest: bool,
pub include_sidechain: bool,
}Expand description
The resolved global flags a reporting command needs.
Borrowed rather than owned so main can resolve config and paths once and
hand the same view to every command.
Fields§
§config: &'a Config§paths: &'a StorePaths§window: TimeWindow§project: Option<&'a str>§json: bool§no_ingest: bool§include_sidechain: boolSidechain (subagent) events are real spend, so they are in by default.
Implementations§
Source§impl Env<'_>
impl Env<'_>
Sourcepub fn ctx(&self) -> ReportCtx
pub fn ctx(&self) -> ReportCtx
The reporting context, priced from the current config: cost is derived
at read time, so an edit to [pricing.*] re-prices the store on the next
report rather than only on newly ingested events.
Sourcepub fn pre_ingest(&self) -> Result<()>
pub fn pre_ingest(&self) -> Result<()>
The implicit ingest before a report, unless --no-ingest.
Its progress goes to stderr: stdout belongs to the report, and in
--json mode it must stay a single parseable document.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Env<'a>
impl<'a> RefUnwindSafe for Env<'a>
impl<'a> Send for Env<'a>
impl<'a> Sync for Env<'a>
impl<'a> Unpin for Env<'a>
impl<'a> UnsafeUnpin for Env<'a>
impl<'a> UnwindSafe for Env<'a>
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