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.
Members
new
const fn new(entries: &'static [(&'static str, V)]) -> Self
The table of entries, each a path and its value.
get
fn get(self: &Self, path: &str) -> Option<V>
The value of the path path, the first of the table.
entries
fn entries(self: &Self) -> &'static [(&'static str, V)]
The entries, in the order of the generated source.
len
fn len(self: &Self) -> usize
The number of entries.
is_empty
fn is_empty(self: &Self) -> bool
Whether the table has no entry.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEitherDebug
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.