pub trait AnyLocalizationsDelegate: Debug {
// Required methods
fn is_supported(&self, locale: &Locale) -> bool;
fn load(
&self,
app: &mut App,
locale: &Locale,
) -> CompleterFuture<Rc<dyn Any>> ⓘ;
fn should_reload(&self, old: &dyn AnyLocalizationsDelegate) -> bool;
fn type(&self) -> TypeId;
fn runtime_type(&self) -> TypeId;
fn as_any(&self) -> &dyn Any;
}Expand description
The erased form of a LocalizationsDelegate: the delegate as a Localizations
widget holds it, without its resource type.
Required Methods§
Sourcefn is_supported(&self, locale: &Locale) -> bool
fn is_supported(&self, locale: &Locale) -> bool
Sourcefn load(&self, app: &mut App, locale: &Locale) -> CompleterFuture<Rc<dyn Any>> ⓘ
fn load(&self, app: &mut App, locale: &Locale) -> CompleterFuture<Rc<dyn Any>> ⓘ
See LocalizationsDelegate::load; the value holds the Rc<T>.
Sourcefn should_reload(&self, old: &dyn AnyLocalizationsDelegate) -> bool
fn should_reload(&self, old: &dyn AnyLocalizationsDelegate) -> bool
See LocalizationsDelegate::should_reload; false when old is a delegate of
another type.
Sourcefn type(&self) -> TypeId
fn type(&self) -> TypeId
The type of the object returned by the load method, T by default.
This type is used to retrieve the object “loaded” by this
LocalizationsDelegate from the Localizations inherited widget.
For example the object loaded by LocalizationsDelegate<Foo> would
be retrieved with:
Localizations::of::<Foo>(app, context)It’s rarely necessary to override this getter.
Sourcefn runtime_type(&self) -> TypeId
fn runtime_type(&self) -> TypeId
The delegate’s own type, Dart’s runtimeType.
Sourcefn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
The delegate as Any, for should_reload.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".