pub struct ConversionOptions {
pub package_name: PackageName,
pub interface_name: String,
pub singleton_interface: Option<String>,
pub unsupported_features: HandleUnsupported,
pub global_singletons: HashSet<String>,
pub phantom_interface: Vec<String>,
pub phantom_dictionaries: Vec<String>,
pub resource_inheritance: ResourceInheritance,
}Expand description
conversion options.
Fields§
§package_name: PackageNameName of package for generated wit.
When using the outputted wit in a JS environment, it is recommended to use the “webidl:” namespace.
This lets tools like Jco know that this wit represents bindings to built in functions.
Example
PackageName::new("webidl", "my-package", None);interface_name: StringInterface to hold the generated types and functions.
singleton_interface: Option<String>When set, treats the given interface name as a singleton, flattening its functions as top-level interface functions of an interface of the given name.
When using the outputted wit in a JS environment, it is recommended to make this name
match the global name of the interface, with a global- prefix, for transparent runtime
support in Jco.
For example in Jco, globalThis.console or globalThis.navigator.gpu can be reflected as
global-console or global-navigator-gpu respectively to automatically bind these globals.
unsupported_features: HandleUnsupportedSkip unsupported features.
global_singletons: HashSet<String>Items - usually global singletons - that if encountered should get a get-[self] func, and get a dedicated world.
phantom_interface: Vec<String>Add empty interfaces with these names. Useful if the WebIDL references interfaces not defined in the input.
phantom_dictionaries: Vec<String>Add empty dictionary with these names. Useful if the WebIDL references dictionaries not defined in the input.
resource_inheritance: ResourceInheritanceHow to handle resource inheritance.
Trait Implementations§
Source§impl Clone for ConversionOptions
impl Clone for ConversionOptions
Source§fn clone(&self) -> ConversionOptions
fn clone(&self) -> ConversionOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConversionOptions
impl Debug for ConversionOptions
Auto Trait Implementations§
impl Freeze for ConversionOptions
impl RefUnwindSafe for ConversionOptions
impl Send for ConversionOptions
impl Sync for ConversionOptions
impl Unpin for ConversionOptions
impl UnwindSafe for ConversionOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more