pub struct ProjectAliases { /* private fields */ }Expand description
A resolved repo_hash -> display name mapping. Empty = no mapping installed
(the common case), in which case every operation is a no-op and the export is
byte-for-byte identical to the unmapped output.
Implementations§
Source§impl ProjectAliases
impl ProjectAliases
Sourcepub fn default_path() -> Option<PathBuf>
pub fn default_path() -> Option<PathBuf>
The canonical installed location (<config_dir>/finops-aliases.toml).
Sourcepub fn load(explicit: Option<&Path>) -> Self
pub fn load(explicit: Option<&Path>) -> Self
Resolve the active mapping from the source chain: an explicit path
(the --aliases= flag) → LEAN_CTX_FINOPS_ALIASES → the installed file.
A missing file yields an empty (no-op) mapping; a malformed file is
logged and treated as empty, so a typo never breaks the export.
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Sourcepub fn resolve(&self, repo_hash: &str) -> String
pub fn resolve(&self, repo_hash: &str) -> String
The display name for a repo_hash, or the hash itself when unmapped.
Sourcepub fn apply(&self, rows: &mut [DailyCostRow])
pub fn apply(&self, rows: &mut [DailyCostRow])
Relabel the project of each row in place. No-op when the mapping is
empty. Only the export rows are touched — never the ledger.
Trait Implementations§
Source§impl Clone for ProjectAliases
impl Clone for ProjectAliases
Source§fn clone(&self) -> ProjectAliases
fn clone(&self) -> ProjectAliases
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 moreSource§impl Debug for ProjectAliases
impl Debug for ProjectAliases
Source§impl Default for ProjectAliases
impl Default for ProjectAliases
Source§fn default() -> ProjectAliases
fn default() -> ProjectAliases
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProjectAliases
impl RefUnwindSafe for ProjectAliases
impl Send for ProjectAliases
impl Sync for ProjectAliases
impl Unpin for ProjectAliases
impl UnsafeUnpin for ProjectAliases
impl UnwindSafe for ProjectAliases
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more