Trait rquickjs_core::FromJs
source · pub trait FromJs<'js>: Sized {
// Required method
fn from_js(ctx: &Ctx<'js>, value: Value<'js>) -> Result<Self>;
}
Expand description
For converting JavaScript values to Rust values
This trait automatically converts any value which can be
represented as an object, like Array
to one if it is required.
Required Methods§
Object Safety§
Implementations on Foreign Types§
source§impl<'js> FromJs<'js> for SystemTime
impl<'js> FromJs<'js> for SystemTime
source§impl<'js, K, V, S> FromJs<'js> for IndexMap<K, V, S>
Available on crate feature indexmap
only.
impl<'js, K, V, S> FromJs<'js> for IndexMap<K, V, S>
indexmap
only.Convert from JS object to Rust index map
source§impl<'js, L, R> FromJs<'js> for Either<L, R>
Available on crate feature either
only.
impl<'js, L, R> FromJs<'js> for Either<L, R>
either
only.Convert from JS to either
source§impl<'js, T> FromJs<'js> for LinkedList<T>where
T: FromJs<'js>,
impl<'js, T> FromJs<'js> for LinkedList<T>where
T: FromJs<'js>,
Convert from JS array to Rust linked list
source§impl<'js, T> FromJs<'js> for VecDeque<T>where
T: FromJs<'js>,
impl<'js, T> FromJs<'js> for VecDeque<T>where
T: FromJs<'js>,
Convert from JS array to Rust vector deque
source§impl<'js, T, S> FromJs<'js> for IndexSet<T, S>
Available on crate feature indexmap
only.
impl<'js, T, S> FromJs<'js> for IndexSet<T, S>
indexmap
only.Convert from JS array to Rust index set
Implementors§
impl<'js> FromJs<'js> for Array<'js>
impl<'js> FromJs<'js> for Coerced<bool>
Coerce a value to a bool
in the same way JavaScript would coerce values
impl<'js> FromJs<'js> for Coerced<f64>
Coerce a value to a f64
in the same way JavaScript would coerce values
impl<'js> FromJs<'js> for Coerced<i32>
Coerce a value to a i32
in the same way JavaScript would coerce values
impl<'js> FromJs<'js> for Coerced<i64>
Coerce a value to a i64
in the same way JavaScript would coerce values
impl<'js> FromJs<'js> for Coerced<u64>
Coerce a value to a u64
in the same way JavaScript would coerce values
impl<'js> FromJs<'js> for Coerced<String>
Coerce a value to a string in the same way JavaScript would coerce values.
impl<'js> FromJs<'js> for Coerced<String<'js>>
Coerce a value to a string in the same way JavaScript would coerce values.
impl<'js> FromJs<'js> for Constructor<'js>
impl<'js> FromJs<'js> for Function<'js>
impl<'js> FromJs<'js> for Object<'js>
impl<'js> FromJs<'js> for MaybePromise<'js>
impl<'js> FromJs<'js> for Promise<'js>
impl<'js> FromJs<'js> for ArrayBuffer<'js>
impl<'js> FromJs<'js> for BigInt<'js>
impl<'js> FromJs<'js> for Exception<'js>
impl<'js> FromJs<'js> for Null
impl<'js> FromJs<'js> for rquickjs_core::String<'js>
impl<'js> FromJs<'js> for Symbol<'js>
impl<'js> FromJs<'js> for Undefined
impl<'js> FromJs<'js> for Value<'js>
impl<'js, A> FromJs<'js> for List<(A,)>where
A: FromJs<'js>,
impl<'js, A, B> FromJs<'js> for List<(A, B)>
impl<'js, A, B, C> FromJs<'js> for List<(A, B, C)>
impl<'js, A, B, C, D> FromJs<'js> for List<(A, B, C, D)>
impl<'js, A, B, C, D, E> FromJs<'js> for List<(A, B, C, D, E)>
impl<'js, A, B, C, D, E, F> FromJs<'js> for List<(A, B, C, D, E, F)>
impl<'js, A, B, C, D, E, F, G> FromJs<'js> for List<(A, B, C, D, E, F, G)>
impl<'js, A, B, C, D, E, F, G, H> FromJs<'js> for List<(A, B, C, D, E, F, G, H)>
impl<'js, A, B, C, D, E, F, G, H, I> FromJs<'js> for List<(A, B, C, D, E, F, G, H, I)>
impl<'js, A, B, C, D, E, F, G, H, I, J> FromJs<'js> for List<(A, B, C, D, E, F, G, H, I, J)>
impl<'js, A, B, C, D, E, F, G, H, I, J, K> FromJs<'js> for List<(A, B, C, D, E, F, G, H, I, J, K)>
impl<'js, A, B, C, D, E, F, G, H, I, J, K, L> FromJs<'js> for List<(A, B, C, D, E, F, G, H, I, J, K, L)>
impl<'js, A, B, C, D, E, F, G, H, I, J, K, L, M> FromJs<'js> for List<(A, B, C, D, E, F, G, H, I, J, K, L, M)>
impl<'js, A, B, C, D, E, F, G, H, I, J, K, L, M, N> FromJs<'js> for List<(A, B, C, D, E, F, G, H, I, J, K, L, M, N)>
impl<'js, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> FromJs<'js> for List<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)>
impl<'js, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> FromJs<'js> for List<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)>
impl<'js, C: JsClass<'js>> FromJs<'js> for Class<'js, C>
impl<'js, T> FromJs<'js> for TypedArray<'js, T>where
T: TypedArrayItem,
impl<'js, T> FromJs<'js> for Result<T>where
T: FromJs<'js>,
Convert from JS as result