pub struct JsVec<T> { /* private fields */ }
Expand description

Reference to a JavaScript array which is expected to contain a specific type of item.

All TryFrom / TryInto conversions use type checking, but FromExpectedType / IntoExpectedType possibly don’t.

The implementation for Into<Vec<T>> uses IntoExpectedType internally.

Trait notes: implements TryInto<Vec<T>>, but Vec<T> does not implement TryFrom<JsVec<T>> due to coherence issues.

Implementations

Gets an item, panicking if the types don’t match and check-all-casts is enabled.

Gets an item, returning an error if the types don’t match and check-all-casts is enabled.

Iterates over elements, panicking if any are not the expected type and check-all-casts is enabled.

Iterates over elements, returning an error if any are not the expected type and check-all-casts is enabled.

Use IntoIterator::into_iter to iterate expecting all types match.

Iterates over elements, consuming self and returning a result if any are not the expected type.

Use IntoIterator::into_iter to iterate expecting all types match.

Turns this remote JS array into a local Vec, returning an error if any elements are not the expected type and check-all-casts is enabled.

Turns this remote JS array into a local Vec, panicking if any elements are not the expected type and check-all-casts is enabled.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Converts this type into a shared reference of the (usually inferred) input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Checks whenever a given Reference if of type Self.

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Converts a given reference into a concrete reference-like wrapper. Doesn’t do any type checking; highly unsafe to use! 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.

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.

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.

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

Returns the argument unchanged.

Calls U::from(self).

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

Casts this value as the target type, making the assumption that the types are correct. 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.

The type returned in the event of a conversion error.

Performs the conversion.