FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    IDeferredContent

    trait · ferroui-base · v0.5.0

    trait IDeferredContent
    

    Represents a deferred content: content that is built on demand, the first time it is requested.

    View source

    Members

    build

    fn build(self: &Self, service_provider: Option<&Rc<dyn IServiceProvider>>) -> Option<BoxedValue>
    

    Builds the deferred content. service_provider is the service provider to build it with, if any; deferred resources are built with none.

    Source

    try_build

    fn try_build(self: &Self, service_provider: Option<&Rc<dyn IServiceProvider>>) -> Result<Option<BoxedValue>, DeferredContentFailed>
    

    Builds the deferred content, or reports that it could not be built.

    Err means that the build failed and that the content reported its error itself: the deferred content of the markup runtime gives it to the open error scope of the load (ferroui_markup_xaml::xaml_error_scope), which returns it as the error of the load. The caller then goes on as if the content were not there, and does not keep the failed build: the next request builds again. Content without an error channel never fails; the default builds with build.

    An addition (#567): where the reference throws out of the build, this reports the error without unwinding, so that a load can return it with panic = "abort".

    Source

    Availability

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