pub enum ZapParam {
    String(String),
    ReadOnlyU8Buffer(Arc<Vec<u8>>),
    ReadOnlyU32Buffer(Arc<Vec<u32>>),
    ReadOnlyF32Buffer(Arc<Vec<f32>>),
    MutableU8Buffer(Vec<u8>),
    MutableF32Buffer(Vec<f32>),
    MutableU32Buffer(Vec<u32>),
}

Variants

String(String)

An arbitrary string supplied by the user (e.g. JSON encoded). TODO(Paras): I wish I could just put references here, since we end up cloning the string anyways when calling zerde. But then we have to declare many lifetimes - maybe worth it.

ReadOnlyU8Buffer(Arc<Vec<u8>>)

Buffers to pass read-only memory from JS to Rust

ReadOnlyU32Buffer(Arc<Vec<u32>>)

ReadOnlyF32Buffer(Arc<Vec<f32>>)

MutableU8Buffer(Vec<u8>)

Buffers to transfer ownership of memory from JS to Rust

MutableF32Buffer(Vec<f32>)

MutableU32Buffer(Vec<u32>)

Implementations

Borrow contents of ZapParam::String as &str.

Borrow contents of ZapParam::MutableU8Buffer or ZapParam::ReadOnlyU8Buffer as &[u8].

Borrow contents of ZapParam::MutableU32Buffer or ZapParam::ReadOnlyU32Buffer as &[u32].

Borrow contents of ZapParam::MutableF32Buffer or ZapParam::ReadOnlyF32Buffer as &[f32].

Get contents of ZapParam::ReadOnlyU8Buffer, without having to consume it.

Get contents of ZapParam::ReadOnlyU32Buffer, without having to consume it.

Get contents of ZapParam::ReadOnlyF32Buffer, without having to consume it.

Get contents of ZapParam::String, consuming it.

Get contents of ZapParam::MutableU8Buffer, consuming it.

Get contents of ZapParam::MutableU32Buffer, consuming it.

Get contents of ZapParam::MutableF32Buffer, consuming it.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.