BlobMethods

pub trait BlobMethods<D: DomTypes> {
    // Required methods
    fn Size(&self) -> u64;
    fn Type(&self) -> DOMString;
    fn Slice(
        &self,
        cx: &mut JSContext,
        start: Option<i64>,
        end: Option<i64>,
        contentType: Option<DOMString>,
    ) -> DomRoot<D::Blob>;
    fn Stream(&self, cx: &mut JSContext) -> Fallible<DomRoot<D::ReadableStream>>;
    fn Text(&self, realm: &mut CurrentRealm<'_>) -> Rc<D::Promise>;
    fn ArrayBuffer(&self, _comp: InRealm<'_>, _can_gc: CanGc) -> Rc<D::Promise>;
    fn Bytes(&self, _comp: InRealm<'_>, _can_gc: CanGc) -> Rc<D::Promise>;
    fn Constructor(
        cx: &mut JSContext,
        global: &D::GlobalScope,
        proto: Option<HandleObject<'_>>,
        blobParts: Option<Vec<ArrayBufferOrArrayBufferViewOrBlobOrString<D>>>,
        options: &BlobPropertyBag,
    ) -> Fallible<DomRoot<D::Blob>>;
}

Required Methods§

Source

fn Size(&self) -> u64

Source

fn Type(&self) -> DOMString

Source

fn Slice( &self, cx: &mut JSContext, start: Option<i64>, end: Option<i64>, contentType: Option<DOMString>, ) -> DomRoot<D::Blob>

Source

fn Stream(&self, cx: &mut JSContext) -> Fallible<DomRoot<D::ReadableStream>>

Source

fn Text(&self, realm: &mut CurrentRealm<'_>) -> Rc<D::Promise>

Source

fn ArrayBuffer(&self, _comp: InRealm<'_>, _can_gc: CanGc) -> Rc<D::Promise>

Source

fn Bytes(&self, _comp: InRealm<'_>, _can_gc: CanGc) -> Rc<D::Promise>

Source

fn Constructor( cx: &mut JSContext, global: &D::GlobalScope, proto: Option<HandleObject<'_>>, blobParts: Option<Vec<ArrayBufferOrArrayBufferViewOrBlobOrString<D>>>, options: &BlobPropertyBag, ) -> Fallible<DomRoot<D::Blob>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§