pub struct Content(/* private fields */);Expand description
A reusable factory for an authored HTML template component.
Clone shares factory identity, never DOM or a mounted lifetime. Each slot prepares a fresh child of its receiving component; captured Rust values keep their ordinary lexical scope. Construct content once and pass clones to slots. Making a new factory in a reactive slot expression deliberately replaces it.
Implementations§
Source§impl Content
impl Content
pub fn new<C: TemplateComponent>( make: impl Fn(OwnerHandle) -> C + 'static, ) -> Self
Sourcepub fn try_new<C: TemplateComponent>(
make: impl Fn(OwnerHandle) -> Result<C, JsValue> + 'static,
) -> Self
pub fn try_new<C: TemplateComponent>( make: impl Fn(OwnerHandle) -> Result<C, JsValue> + 'static, ) -> Self
Fallible constructor; owner-activation registrations wait for the receiving scope’s commit. Ordinary constructor effects retain their immediate timing.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Content
impl !Send for Content
impl !Sync for Content
impl !UnwindSafe for Content
impl Freeze for Content
impl Unpin for Content
impl UnsafeUnpin for Content
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more