FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    FerroXamlLoader

    struct · ferroui-markup-xaml · v0.5.0

    struct FerroXamlLoader
    

    Loads XAML for a FerroUI application.

    View source

    Members

    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).

    Source

    unregister_compiled_xaml

    fn unregister_compiled_xaml(assembly_name: &str) -> bool
    

    Removes the registration of an assembly. Returns whether there was one.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    scoped_populate_override

    fn scoped_populate_override(class: &'static TypeInfo, populate: PopulateOverride) -> PopulateOverrideGuard
    

    Constructor overrides take precedence over persistent development overrides.

    Source

    set_populate_override

    fn set_populate_override(class: &'static TypeInfo, populate: Option<PopulateOverride>) -> Option<PopulateOverride>
    

    Source

    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.

    Source

    populate_override

    fn populate_override(class: &'static TypeInfo) -> Option<PopulateOverride>
    

    Source

    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.

    Source

    live_instances

    fn live_instances(class: &'static TypeInfo) -> Vec<ferroui_base::Ref<ferroui_base::FerroObject>>
    

    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
    • MarkupTyped

    Availability

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