[−][src]Struct gloo_file::Blob
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.
Methods
impl Blob
[src]
pub fn new<T>(content: T) -> Blob where
T: BlobContents,
[src]
T: BlobContents,
Create a new Blob
from a &str
, &[u8]
or js_sys::ArrayBuffer
.
pub fn new_with_options<T>(content: T, mime_type: Option<&str>) -> Blob where
T: BlobContents,
[src]
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
[src]
pub fn size(&self) -> u64
[src]
The number of bytes in the Blob/File.
pub fn raw_mime_type(&self) -> String
[src]
The raw MIME type (also known as content type or media type) of the File
or
Blob
.
Trait Implementations
impl AsRef<Blob> for Blob
[src]
impl AsRef<JsValue> for Blob
[src]
impl Debug for Blob
[src]
impl From<Blob> for Blob
[src]
impl From<Blob> for Blob
[src]
impl From<Blob> for JsValue
[src]
impl From<File> for Blob
[src]
impl From<File> for Blob
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,