pub trait BlobContents: Sealed {
    // Required method
    unsafe fn into_jsvalue(self) -> JsValue;
}
Expand description

This trait is used to overload the Blob::new_with_options function, allowing a variety of types to be used to create a Blob. Ignore this, and use &[u8], &str, etc to create a Blob.

The trait is sealed: it can only be implemented by types in this crate, as this crate relies on invariants regarding the JsValue returned from into_jsvalue.

Required Methods§

source

unsafe fn into_jsvalue(self) -> JsValue

Safety

For &[u8] and &str, the returned Uint8Array must be modified, and must not be kept past the lifetime of the original slice.

Implementations on Foreign Types§

source§

impl<'a> BlobContents for &'a str

source§

unsafe fn into_jsvalue(self) -> JsValue

source§

impl BlobContents for ArrayBuffer

source§

unsafe fn into_jsvalue(self) -> JsValue

source§

impl BlobContents for JsString

source§

unsafe fn into_jsvalue(self) -> JsValue

source§

impl<'a> BlobContents for &'a [u8]

source§

unsafe fn into_jsvalue(self) -> JsValue

Implementors§