Skip to main content

DeploymentRoles

Struct DeploymentRoles 

Source
pub struct DeploymentRoles { /* private fields */ }
Expand description

The set of Marktrolles this makod deployment fills.

Used by EngineModule::register_pids_with_roles to conditionally register PID routes based on which roles are active. Modules check roles.contains(Marktrolle::Nb) before registering role-specific PIDs.

§Constructors

§Conflict guard

When two modules both register the same PID to different workflow names, EngineBuilder::build will detect the conflict and panic. Set exclusive roles to ensure only one workflow is registered per shared PID:

// NB deployment: GPKE registers 19001/19002 → gpke-konfiguration
// nMSB deployment: WiM registers 19001/19002 → wim-geraeteubernahme
// Combined (conflict!): set roles to prevent double-registration:
use mako_engine::marktrolle::{DeploymentRoles, Marktrolle};

let roles = DeploymentRoles::from_roles([Marktrolle::Nb]);
// Now only GPKE registers 19001/19002; WiM skips its nMSB-conditional block.

Implementations§

Source§

impl DeploymentRoles

Source

pub fn all() -> Self

All roles active — contains always returns true.

The default for EngineBuilder. Modules register all their PIDs unconditionally, identical to the pre-role-aware behavior.

Warning: if two modules register the same PID to different workflows and all() is active, the conflict guard in PidRouter will panic at build time. Use from_roles to specify exactly which roles apply.

Source

pub fn from_roles(roles: impl IntoIterator<Item = Marktrolle>) -> Self

Construct from an explicit set of active roles.

Only modules whose role-conditional PID blocks include at least one of these roles will register those PIDs. All non-role-conditional PID blocks (i.e., those that don’t call roles.contains(...)) are always registered.

Source

pub fn contains(&self, role: Marktrolle) -> bool

Return true when role is active.

Always returns true for DeploymentRoles::all().

Source

pub fn is_all(&self) -> bool

Return true when this is the all() sentinel (no explicit role list).

Source

pub fn nb() -> Self

NB-only deployment (most common for grid operators).

Source

pub fn lf() -> Self

LF-only deployment (supplier side).

Source

pub fn msb() -> Self

gMSB-only deployment (incumbent meter operator).

Source

pub fn nmsb() -> Self

nMSB-only deployment (challenger meter operator).

Source

pub fn nb_msb() -> Self

NB + gMSB (most common municipal utility / Stadtwerke combination).

Source

pub fn nb_bkv() -> Self

NB + BKV (grid operator that also manages its own balance group).

Source

pub fn with(self, role: Marktrolle) -> Self

Add a role to an existing set, returning a new DeploymentRoles.

Trait Implementations§

Source§

impl Clone for DeploymentRoles

Source§

fn clone(&self) -> DeploymentRoles

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 DeploymentRoles

Source§

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

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

impl Default for DeploymentRoles

Source§

fn default() -> Self

Defaults to all — every role is considered active.

This preserves backward-compatible behavior (all PIDs registered) for deployments that have not yet configured explicit roles. Set explicit roles via DeploymentRoles::from_roles for multi-role conflict safety.

Source§

impl FromIterator<Marktrolle> for DeploymentRoles

Source§

fn from_iter<T: IntoIterator<Item = Marktrolle>>(iter: T) -> Self

Creates a value from an iterator. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more