Skip to main content

ChartTranslation

Struct ChartTranslation 

Source
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: String

The national chart, for example de-skr04.

§version: String

Its version.

§into: String

The harmonised chart and version it translates into, as name/version.

§accounts: BTreeMap<String, AccountId>

National account number → harmonised account.

Implementations§

Source§

impl ChartTranslation

Source

pub fn fr_pcg() -> Self

The translation of the French Plan comptable général, version of 1 January 2026, into the harmonised chart 0.1 (spec/data/translations/fr-pcg.json).

Source§

impl ChartTranslation

Source

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.

Source

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).

Source

pub fn national(&self, id: &AccountId) -> Option<&str>

The national account for a harmonised one, if the translation is reversible there.

Trait Implementations§

Source§

impl Clone for ChartTranslation

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for ChartTranslation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ChartTranslation

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ChartTranslation

Source§

impl Object for ChartTranslation

Source§

const TYPE: &'static str = "chart_translation"

The type, written as "type" when the object stands on its own.
Source§

impl PartialEq for ChartTranslation

Source§

fn eq(&self, other: &ChartTranslation) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ChartTranslation

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ChartTranslation

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.