gossamer/blob

Types

A file-like object of immutable, raw data. Blobs represent data that isn’t necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user’s system.

pub type Blob

Values

pub fn from_bytes(bytes: uint8_array.Uint8Array) -> Blob

Creates a new Blob from a Uint8Array.

pub fn from_bytes_with_type(
  bytes: uint8_array.Uint8Array,
  mime_type: String,
) -> Blob

Creates a new Blob from a Uint8Array with a MIME type.

pub fn from_string(content: String) -> Blob

Creates a new Blob from a string.

pub fn from_string_with_type(
  content: String,
  mime_type: String,
) -> Blob

Creates a new Blob from a string with a MIME type.

pub fn new() -> Blob

Creates a new Blob with no content.

pub fn size(blob: Blob) -> Int
pub fn slice(blob: Blob, start: Int, end: Int) -> Blob
pub fn slice_with_type(
  blob: Blob,
  start: Int,
  end: Int,
  content_type: String,
) -> Blob
pub fn text(blob: Blob) -> promise.Promise(String)
pub fn type_(blob: Blob) -> String
Search Document