Struct v8::WasmStreaming

source ·
#[repr(C)]
pub struct WasmStreaming(_);
Expand description

The V8 interface for WebAssembly streaming compilation. When streaming compilation is initiated, V8 passes a Self object to the embedder such that the embedder can pass the input bytes for streaming compilation to V8.

Implementations§

source§

impl WasmStreaming

source

pub fn on_bytes_received(&mut self, data: &[u8])

Pass a new chunk of bytes to WebAssembly streaming compilation.

source

pub fn finish(self)

Should be called after all received bytes where passed to Self::on_bytes_received() to tell V8 that there will be no more bytes. Does not have to be called after Self::abort() has been called already.

source

pub fn abort(self, exception: Option<Local<'_, Value>>)

Abort streaming compilation. If {exception} has a value, then the promise associated with streaming compilation is rejected with that value. If {exception} does not have value, the promise does not get rejected.

source

pub fn set_url(&mut self, url: &str)

Sets the UTF-8 encoded source URL for the Script object. This must be called before Self::finish().

Trait Implementations§

source§

impl Drop for WasmStreaming

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.