FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    NameTable

    struct · ferroui-static-view-locator · v0.5.0

    struct NameTable<V: Copy + 'static>
    

    A table of values by the path of a generic type definition (type.GetGenericTypeDefinition() as the key of the legacy fallback): the path of the declaration of the type, as std::any::type_name writes it without its generic arguments (my_app::view_models::WidgetViewModel).

    Not an upstream type: a Rust generic type has no run-time definition, and the TypeId of each of its instantiations is its own. The legacy fallback of the reference finds the view of WidgetViewModel<int> through the definition WidgetViewModel<>; the port finds it through the path of the definition, which RuntimeType::generic_definition gives for a value.

    View source

    Members

    new

    const fn new(entries: &'static [(&'static str, V)]) -> Self
    

    The table of entries, each a path and its value.

    Source

    get

    fn get(self: &Self, path: &str) -> Option<V>
    

    The value of the path path, the first of the table.

    Source

    entries

    fn entries(self: &Self) -> &'static [(&'static str, V)]
    

    The entries, in the order of the generated source.

    Source

    len

    fn len(self: &Self) -> usize
    

    The number of entries.

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    Whether the table has no entry.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • Debug

    Availability

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