pub struct PreviewFrame { /* private fields */ }Expand description
What the preview frame’s document needs, read once at start: the inline runtime, its SHA-256 and the application’s origin (see the module docs).
Implementations§
Source§impl PreviewFrame
impl PreviewFrame
Sourcepub fn load<A: Embed>(
manifest: &AssetManifest,
app_origin: &str,
) -> Result<Self, FrameError>
pub fn load<A: Embed>( manifest: &AssetManifest, app_origin: &str, ) -> Result<Self, FrameError>
Read the runtime the manifest names under FRAME_RUNTIME_ASSET from
the application’s embedded files A, hash it for script-src, and
check app_origin, the origin of the pages that frame it
(https://studio.example).
§Errors
FRAME-101 to FRAME-104 (see the module docs); refuse to
start on any of them.
Verified by: crates/forma-server/tests/internal_renderer/preview_frame.rs > “a_frame_without_its_runtime_is_a_coded_error_at_start”
Sourcepub fn app_origin(&self) -> &str
pub fn app_origin(&self) -> &str
The origin the frame’s frame-ancestors names, in lower case.
Trait Implementations§
Source§impl Clone for PreviewFrame
impl Clone for PreviewFrame
Auto Trait Implementations§
impl Freeze for PreviewFrame
impl RefUnwindSafe for PreviewFrame
impl Send for PreviewFrame
impl Sync for PreviewFrame
impl Unpin for PreviewFrame
impl UnsafeUnpin for PreviewFrame
impl UnwindSafe for PreviewFrame
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