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
sourceimpl Blob
impl Blob
sourcepub fn new<T>(content: T) -> Blob where
T: BlobContents,
pub fn new<T>(content: T) -> Blob where
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>) -> Blob where
T: BlobContents,
pub fn new_with_options<T>(content: T, mime_type: Option<&str>) -> Blob where
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
sourceimpl BlobContents for Blob
impl BlobContents for Blob
sourceunsafe fn into_jsvalue(self) -> JsValue
unsafe fn into_jsvalue(self) -> JsValue
Safety Read more
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more