pub struct Blob { /* private fields */ }
Expand description
A Blob
.
Blob
s can be created directly from &str
, &[u8]
, and js_sys::ArrayBuffer
s using the
Blob::new
or Blob::new_with_options
functions.
Implementations§
source§impl Blob
impl Blob
sourcepub fn new<T>(content: T) -> Blobwhere
T: BlobContents,
pub fn new<T>(content: T) -> Blobwhere T: BlobContents,
Create a new Blob
from a &str
, &[u8]
or js_sys::ArrayBuffer
.
sourcepub fn new_with_options<T>(content: T, mime_type: Option<&str>) -> Blobwhere
T: BlobContents,
pub fn new_with_options<T>(content: T, mime_type: Option<&str>) -> Blobwhere T: BlobContents,
Like new
, but allows specifying the MIME type (also known as content type or media
type) of the Blob
.
pub fn slice(&self, start: u64, end: u64) -> Self
sourcepub fn raw_mime_type(&self) -> String
pub fn raw_mime_type(&self) -> String
The raw MIME type (also known as content type or media type) of the File
or
Blob
.
Trait Implementations§
source§impl BlobContents for Blob
impl BlobContents for Blob
source§unsafe fn into_jsvalue(self) -> JsValue
unsafe fn into_jsvalue(self) -> JsValue
Safety Read more
source§impl PartialEq<Blob> for Blob
impl PartialEq<Blob> for Blob
impl Eq for Blob
impl StructuralEq for Blob
impl StructuralPartialEq for Blob
Auto Trait Implementations§
impl RefUnwindSafe for Blob
impl !Send for Blob
impl !Sync for Blob
impl Unpin for Blob
impl UnwindSafe for Blob
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