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.
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).
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.
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
fn source(self: &Self) -> Option<UriRef>
The source URL: an absolute URL, or a reference relative to the base URI of the include.
set_source
fn set_source(self: &Self, value: Option<UriRef>)
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.
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.
as_style
fn as_style(self: &Self) -> Rc<dyn IStyle>
The include as the style contract.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyAnyValueClassDefaultsErasedDestructorIntoEitherIResourceNodeIStyleIResourceProviderPartialEqMarkupTyped
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.