pub struct ChartTranslation {
pub chart: String,
pub version: String,
pub into: String,
pub accounts: BTreeMap<String, AccountId>,
}Expand description
How a national chart of accounts translates into the harmonised one: each national account onto exactly one harmonised account.
Fields§
§chart: StringThe national chart, for example de-skr04.
version: StringIts version.
into: StringThe harmonised chart and version it translates into, as name/version.
accounts: BTreeMap<String, AccountId>National account number → harmonised account.
Implementations§
Source§impl ChartTranslation
impl ChartTranslation
Sourcepub fn validate(&self, chart: &Chart) -> Result<(), TranslationError>
pub fn validate(&self, chart: &Chart) -> Result<(), TranslationError>
Checks the translation against the harmonised chart. Every national account maps onto exactly one account by construction (unambiguous); this checks that those accounts exist.
Sourcepub fn coarser_accounts(&self) -> Vec<AccountId>
pub fn coarser_accounts(&self) -> Vec<AccountId>
Whether the translation can be reversed: no two national accounts map onto the same harmonised account. Where this fails, the harmonised chart is coarser than the national one and has to grow (the model grows, translations do not bend).
Trait Implementations§
Source§impl Clone for ChartTranslation
impl Clone for ChartTranslation
Source§fn clone(&self) -> ChartTranslation
fn clone(&self) -> ChartTranslation
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 ChartTranslation
impl Debug for ChartTranslation
Source§impl<'de> Deserialize<'de> for ChartTranslation
impl<'de> Deserialize<'de> for ChartTranslation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ChartTranslation
Source§impl Object for ChartTranslation
impl Object for ChartTranslation
Source§impl PartialEq for ChartTranslation
impl PartialEq for ChartTranslation
Source§impl Serialize for ChartTranslation
impl Serialize for ChartTranslation
impl StructuralPartialEq for ChartTranslation
Auto Trait Implementations§
impl Freeze for ChartTranslation
impl RefUnwindSafe for ChartTranslation
impl Send for ChartTranslation
impl Sync for ChartTranslation
impl Unpin for ChartTranslation
impl UnsafeUnpin for ChartTranslation
impl UnwindSafe for ChartTranslation
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