Struct Editor Asset
pub struct EditorAsset<'a> {
pub path: &'a str,
pub mime: &'a str,
pub data: &'a [u8],
}Expand description
A file the editor page loads by relative URL, embedded in the binary, for
example EditorAsset::new("img/knob.png", include_bytes!("../editor/img/knob.png")).
With assets, the editor page is served from a local asset origin together with them, so images, fonts, scripts and styles need not be inlined into the 1 MiB page or sent through 64 KiB editor messages. Requests are answered from memory: no file system or network access is involved.
Fields§
§path: &'a strRelative path: ASCII letters, digits and ._-/, at most 512 bytes, no
., .. or empty segment, no leading or trailing /. index.html is
reserved for the page.
mime: &'a strContent type such as image/png; empty infers it from the extension.
data: &'a [u8]Implementations§
§impl<'a> EditorAsset<'a>
impl<'a> EditorAsset<'a>
Trait Implementations§
§impl<'a> Clone for EditorAsset<'a>
impl<'a> Clone for EditorAsset<'a>
§fn clone(&self) -> EditorAsset<'a>
fn clone(&self) -> EditorAsset<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for EditorAsset<'a>
§impl<'a> Debug for EditorAsset<'a>
impl<'a> Debug for EditorAsset<'a>
impl<'a> Eq for EditorAsset<'a>
§impl<'a> PartialEq for EditorAsset<'a>
impl<'a> PartialEq for EditorAsset<'a>
impl<'a> StructuralPartialEq for EditorAsset<'a>
Auto Trait Implementations§
impl<'a> Freeze for EditorAsset<'a>
impl<'a> RefUnwindSafe for EditorAsset<'a>
impl<'a> Send for EditorAsset<'a>
impl<'a> Sync for EditorAsset<'a>
impl<'a> Unpin for EditorAsset<'a>
impl<'a> UnsafeUnpin for EditorAsset<'a>
impl<'a> UnwindSafe for EditorAsset<'a>
Blanket Implementations§
impl<T> AutoreleaseSafe for T
§impl<T> BorrowMut<T> for T
impl<T> BorrowMut<T> for T
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more