Skip to main content

Bo4eObject

Trait Bo4eObject 

Source
pub trait Bo4eObject: Sealed {
    type BoTyp;

    // Required methods
    fn bo_type(&self) -> Self::BoTyp;
    fn schema_version(&self) -> &'static str;
}
Available on crate feature versioned only.
Expand description

Marker trait implemented by every generated BO4E business object (Geschäftsobjekt).

Provides runtime access to the BO type discriminant and the schema version that was used to generate this type. COM types and enums do NOT implement this trait.

§Sealed trait

Bo4eObject is sealed — it cannot be implemented by types outside this crate. This allows the library to add new methods in future releases without breaking downstream code that merely uses the trait.

§Design note — associated type over bare return type

bo_type() returns Self::BoTyp (an associated type) so that the single trait definition in src/lib.rs can serve all schema versions while keeping each version’s BoTyp enum strongly typed. For dyn usage, bind the associated type:

ⓘ
use rubo4e::v202607::BoTyp;
let objects: Vec<Box<dyn rubo4e::Bo4eObject<BoTyp = BoTyp>>> = vec![
    Box::new(Vertrag::default()),
    Box::new(Marktlokation::default()),
];
for obj in &objects {
    println!("{:?} schema={}", obj.bo_type(), obj.schema_version());
}

§Example

ⓘ
use rubo4e::prelude::*;
let v = Vertrag::default();
assert_eq!(v.bo_type(), BoTyp::Vertrag);
assert_eq!(v.schema_version(), "v202607.0.0");

Required Associated Types§

Source

type BoTyp

The BO type discriminant enum for this schema version (e.g. v202607::BoTyp).

Required Methods§

Source

fn bo_type(&self) -> Self::BoTyp

Returns the Self::BoTyp discriminant identifying this business object.

Source

fn schema_version(&self) -> &'static str

Returns the BO4E schema version tag used to generate this type (e.g. "v202607.0.0").

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Bo4eObject for Angebot

Source§

impl Bo4eObject for Ausschreibung

Source§

impl Bo4eObject for Bilanzierung

Source§

impl Bo4eObject for Buendelvertrag

Source§

impl Bo4eObject for Energiemenge

Source§

impl Bo4eObject for Fremdkosten

Source§

impl Bo4eObject for Geraet

Source§

impl Bo4eObject for Geschaeftspartner

Source§

impl Bo4eObject for Kosten

Source§

impl Bo4eObject for Lastgang

Source§

impl Bo4eObject for Lokationszuordnung

Source§

impl Bo4eObject for Marktlokation

Source§

impl Bo4eObject for Marktteilnehmer

Source§

impl Bo4eObject for Messlokation

Source§

impl Bo4eObject for Netzlokation

Source§

impl Bo4eObject for Person

Source§

impl Bo4eObject for Preisblatt

Source§

impl Bo4eObject for PreisblattDienstleistung

Source§

impl Bo4eObject for PreisblattHardware

Source§

impl Bo4eObject for PreisblattKonzessionsabgabe

Source§

impl Bo4eObject for PreisblattMessung

Source§

impl Bo4eObject for PreisblattNetznutzung

Source§

impl Bo4eObject for Rechnung

Source§

impl Bo4eObject for Region

Source§

impl Bo4eObject for Standorteigenschaften

Source§

impl Bo4eObject for SteuerbareRessource

Source§

impl Bo4eObject for Tarif

Source§

impl Bo4eObject for Tarifinfo

Source§

impl Bo4eObject for Tarifkosten

Source§

impl Bo4eObject for Tarifpreisblatt

Source§

impl Bo4eObject for TechnischeRessource

Source§

impl Bo4eObject for Vertrag

Source§

impl Bo4eObject for Zaehler

Source§

impl Bo4eObject for Zaehlzeitdefinition

Source§

impl Bo4eObject for Zeitreihe