Skip to main content

ToLayout

Trait ToLayout 

Source
pub(crate) trait ToLayout<'dom, T: DomObject> {
    // Required method
    unsafe fn to_layout(&self) -> LayoutDom<'dom, T>;
}

Required Methods§

Source

unsafe fn to_layout(&self) -> LayoutDom<'dom, T>

Get a reference to the contents of this smart pointer as a LayoutDom, for use during layout. Note that this should only be called in the course of layout.

§Safety

The return value holds a Rust reference to the underlying data, which should be safe as long as unsafe is not used to override the lifetime in some way.

  • The caller must not modify the underlying DOM object via non-layout handles.
  • The caller must ensure that garbage collection does not occur while the LayoutDom handle is alive.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'dom, T: DomObject> ToLayout<'dom, T> for Dom<T>

Source§

impl<'dom, T: DomObject> ToLayout<'dom, T> for MutDom<T>