FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    StyleInclude

    struct · ferroui-markup-xaml · v0.5.0

    struct StyleInclude
    

    Includes a style from a URL.

    The document is loaded the first time the style is asked for.

    View source

    Members

    new

    fn new(base_uri: Option<url::Url>) -> Rc<Self>
    

    Initializes a new instance: base_uri is the URL of the document that contains the include, which a relative source is resolved against (UriRef::resolve).

    Source

    with_service_provider

    fn with_service_provider(service_provider: Rc<dyn IServiceProvider>) -> Rc<Self>
    

    Initializes a new instance with the service provider of the place the include is declared in.

    Source

    owner

    fn owner(self: &Self) -> Option<ResourceHostRef>
    

    The owner of the loaded style, if it is a resource provider.

    Inside an error scope of a load, a document that cannot be loaded is the error of the scope and there is no owner.

    Source

    source

    fn source(self: &Self) -> Option<UriRef>
    

    The source URL: an absolute URL, or a reference relative to the base URI of the include.

    Source

    set_source

    fn set_source(self: &Self, value: Option<UriRef>)
    

    Source

    loaded

    fn loaded(self: &Self) -> Rc<dyn IStyle>
    

    The loaded style; loads it on first use.

    Panics

    Panics if source is not set, if the document cannot be loaded or if it is not a style. Use try_loaded to handle a document that cannot be loaded.

    Source

    try_loaded

    fn try_loaded(self: &Self) -> Result<Rc<dyn IStyle>, XamlLoadError>
    

    The loaded style; loads it on first use. A missing source, a document that cannot be loaded and a document that is not a style are errors.

    Source

    as_style

    fn as_style(self: &Self) -> Rc<dyn IStyle>
    

    The include as the style contract.

    Source

    Trait implementations

    Availability

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