blob: 8c477b1ab7849a321ae4df193079a2537fb21665 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
/// A version of the `Into<T>` trait from the standard library that can be used
/// to convert between two types that are not defined in the script crate.
/// This is intended to be used on dict/enum types generated from WebIDL once
/// those types are moved out of the script crate.
pub(crate) trait Convert<T> {
fn convert(self) -> T;
}
/// A version of the `TryInto<T>` trait from the standard library that can be used
/// to convert between two types that are not defined in the script crate.
/// This is intended to be used on dict/enum types generated from WebIDL once
/// those types are moved out of the script crate.
#[cfg(feature = "webgpu")]
pub(crate) trait TryConvert<T> {
type Error;
fn try_convert(self) -> Result<T, Self::Error>;
}
|