FerroXamlLoader
struct · ferroui-markup-xaml · v0.5.0
struct FerroXamlLoader
Loads XAML for a FerroUI application.
Members
register_compiled_xamlunregister_compiled_xamlload_objectload_object_with_service_providerloadload_with_service_providertry_load_with_service_providerscoped_populate_overrideset_populate_overrideremove_populate_overridepopulate_overridetrack_instancelive_instances
register_compiled_xaml
fn register_compiled_xaml(assembly_name: &str, try_load: CompiledXamlLoader)
Registers the loader of the compiled documents of the assembly
(crate) named assembly_name, replacing a previous registration.
Called by the generated startup code of a crate with compiled XAML.
The assembly of a URI is the one the asset loader reports for it
(IAssetLoader::get_assembly).
unregister_compiled_xaml
fn unregister_compiled_xaml(assembly_name: &str) -> bool
Removes the registration of an assembly. Returns whether there was one.
load_object
fn load_object(obj: &BoxedValue) -> Result<(), XamlLoadError>
Loads the XAML into a FerroUI component.
This is the hook the XAML compiler replaces: in a class with
compiled markup the call is rewritten to the generated populate
method of the class. Reaching it at run time means that no compiled
markup exists for the type of obj, which is the error it reports.
load_object_with_service_provider
fn load_object_with_service_provider(sp: Option<&Rc<dyn IServiceProvider>>, obj: &BoxedValue) -> Result<(), XamlLoadError>
load_object with the service provider of the
place the component is loaded into.
load
fn load(uri: &UriRef, base_uri: Option<&url::Url>) -> Result<BoxedValue, XamlLoadError>
Loads XAML from a URI.
base_uri is the URL uri is relative to; it is required when
uri is relative, which is resolved against it with
UriRef::resolve.
load_with_service_provider
fn load_with_service_provider(sp: Option<&Rc<dyn IServiceProvider>>, uri: &UriRef, base_uri: Option<&url::Url>) -> Result<BoxedValue, XamlLoadError>
Loads XAML from a URI, giving the root of the document sp as its
parent service provider.
Panics
Panics if no asset loader is registered, or if uri is relative and
base_uri is None.
try_load_with_service_provider
fn try_load_with_service_provider(sp: Option<&Rc<dyn IServiceProvider>>, uri: &UriRef, base_uri: Option<&url::Url>) -> Result<BoxedValue, XamlLoadError>
load_with_service_provider
without panics: a missing asset loader and a relative URI without a
base URI are errors too. This is what untyped (metadata) callers
use.
scoped_populate_override
fn scoped_populate_override(class: &'static TypeInfo, populate: PopulateOverride) -> PopulateOverrideGuard
Constructor overrides take precedence over persistent development overrides.
set_populate_override
fn set_populate_override(class: &'static TypeInfo, populate: Option<PopulateOverride>) -> Option<PopulateOverride>
remove_populate_override
fn remove_populate_override(class: &'static TypeInfo, expected: &PopulateOverride)
Removes only the persistent hook owned by the caller. Safe during TLS teardown and independent of any active constructor-scoped override.
populate_override
fn populate_override(class: &'static TypeInfo) -> Option<PopulateOverride>
track_instance
fn track_instance<T: ferroui_base::ObjectType>(class: &'static TypeInfo, root: &ferroui_base::Ref<T>)
Weakly records a component without retaining it or changing its lifetime.
live_instances
fn live_instances(class: &'static TypeInfo) -> Vec<ferroui_base::Ref<ferroui_base::FerroObject>>
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEitherMarkupTyped
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.