ErnComponent

Trait ErnComponent 

Source
pub trait ErnComponent {
    type NextState;

    // Required method
    fn prefix() -> &'static str;
}
Expand description

Represents a component of an Entity Resource Name (ERN).

This trait is used to ensure type safety and proper ordering when building ERNs. Each component in an ERN implements this trait, defining its prefix and the type of the next component that should follow it in the ERN structure.

The trait is primarily used by the ErnBuilder to enforce the correct order of components during ERN construction.

Required Associated Types§

Source

type NextState

The type of the next component that should follow this one in the ERN structure.

This associated type is used by the builder pattern to enforce the correct sequence of components. For example, Domain::NextState is Category, indicating that a Category should follow a Domain in an ERN.

Required Methods§

Source

fn prefix() -> &'static str

Returns the prefix string that should appear before this component in an ERN.

For example, the Domain component has the prefix “ern:” to indicate the start of an ERN string.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ErnComponent for Account

Source§

impl ErnComponent for Category

Source§

impl ErnComponent for Domain

Source§

impl ErnComponent for EntityRoot

Source§

impl ErnComponent for Part

Source§

impl ErnComponent for Parts

Implementation for the Parts component of an ERN.

The Parts component represents a collection of path parts in the ERN. Its NextState is itself, allowing for multiple parts to be added.

Source§

impl ErnComponent for SHA1Name