pub(crate) type HTMLElementOrLong = HTMLElementOrLong<DomTypeHolder>;
Aliased Type§
enum HTMLElementOrLong {
HTMLElement(Root<Dom<HTMLElement>>),
Long(i32),
}
Variants§
Implementations
Source§impl<D: DomTypes> HTMLElementOrLong<D>
impl<D: DomTypes> HTMLElementOrLong<D>
unsafe fn TryConvertToHTMLElement( cx: SafeJSContext, value: HandleValue<'_>, ) -> Result<Option<DomRoot<D::HTMLElement>>, ()>
unsafe fn TryConvertToLong( cx: SafeJSContext, value: HandleValue<'_>, ) -> Result<Option<i32>, ()>
Trait Implementations
Source§impl<D: DomTypes> FromJSValConvertible for HTMLElementOrLong<D>
impl<D: DomTypes> FromJSValConvertible for HTMLElementOrLong<D>
Source§unsafe fn from_jsval(
cx: *mut JSContext,
value: HandleValue<'_>,
_option: (),
) -> Result<ConversionResult<HTMLElementOrLong<D>>, ()>
unsafe fn from_jsval( cx: *mut JSContext, value: HandleValue<'_>, _option: (), ) -> Result<ConversionResult<HTMLElementOrLong<D>>, ()>
Convert
val
to type Self
.
Optional configuration of type T
can be passed as the option
argument.
If it returns Err(())
, a JSAPI exception is pending.
If it returns Ok(Failure(reason))
, there is no pending JSAPI exception.