FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ferro_markup_enum

    macro · ferroui-base · v0.5.0

    macro_rules! ferro_markup_enum
    

    Declares the markup metadata of an enumeration: its members by name.

    ferro_markup_enum!(Dock { Left, Bottom, Right, Top });
    
    // A member whose Rust variant has another name (`Self` is reserved):
    ferro_markup_enum!(RelativeSourceMode { DataContext, TemplatedParent, Self = Self_, FindAncestor });
    
    // A set of flags (a `bitflags!` type): members name their constants.
    ferro_markup_enum!(flags RoutingStrategies {
        Direct = RoutingStrategies::DIRECT,
        Tunnel = RoutingStrategies::TUNNEL,
        Bubble = RoutingStrategies::BUBBLE,
    });
    
    // With attributes or another namespace:
    ferro_markup_enum!(Dock { Left, Bottom, Right, Top }, { namespace: "FerroUI.Controls" });
    

    The members of a plain enumeration are its variants (their numeric value is the discriminant); the members of a flags type are constants with a bits() method. The untyped form of a member is a value of the type itself. Implements MarkupTyped.

    View source

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.