TemplateContent
struct · ferroui-markup-xaml · v0.5.0
struct TemplateContent
Builds the content of templates.
Members
load
fn load(template_content: Option<&BoxedValue>) -> Option<TemplateResult<Ref<Control>>>
Builds template content whose result is a control.
load_as
fn load_as<T: Clone + 'static>(template_content: Option<&BoxedValue>) -> Option<TemplateResult<T>>
Builds template content (the value of a Content property marked as
template content) whose result is a T: the result and the name
scope its named elements were registered in.
Returns None for no content, and for content that built nothing.
The content is the deferred content object the runtime helpers
create (DeferredContent). The delegate form of the managed
original has no counterpart: a function is not an untyped value.
Inside an error scope of a load
(with_xaml_errors), a
failure is the error of the scope and the template builds nothing.
Panics
Outside an error scope, panics if the content is anything else, or if
what it built is not a T.
try_load_as
fn try_load_as<T: Clone + 'static>(template_content: Option<&BoxedValue>) -> Result<Option<TemplateResult<T>>, XamlLoadError>
load_as without panics: unexpected content and a
result of another type are errors. This is what untyped (metadata)
callers use.
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.