Skip to main content

IdGenerator

Trait IdGenerator 

Source
pub trait IdGenerator {
    // Required method
    fn next_id(&mut self) -> MessageId;
}
Expand description

Source of outgoing MessageIds.

Pluggable because constrained devices cannot afford an entropy source, and a Local Controller needs ids that provably cannot collide with the CSMS’s (Part 4 §6.4).

§The uniqueness rule

Part 4 §4.1.4 is stricter than it first looks: a MessageId must differ from every id the same sender has used for a CALL or a SEND on any WebSocket connection under the same Charging Station identity — not merely within one connection. A retransmission of the same message may reuse its id, and nothing else may.

Required Methods§

Source

fn next_id(&mut self) -> MessageId

Produces the next id.

Implementations must satisfy the uniqueness rule above.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§