pub struct WElement(/* private fields */);Available on crate feature
wasm only.Expand description
An HTML element, usable from JavaScript.
The builder methods consume and return the handle so they chain in JS exactly as they do in Rust:
const card = wElement("div").addClass("card").child(wElement("h1").text("Hi"));
card.render(); // '<div class="card"><h1>Hi</h1></div>'Implementations§
Trait Implementations§
Source§impl FromWasmAbi for WElement
impl FromWasmAbi for WElement
Source§impl IntoWasmAbi for WElement
impl IntoWasmAbi for WElement
Source§impl LongRefFromWasmAbi for WElement
impl LongRefFromWasmAbi for WElement
Source§impl OptionFromWasmAbi for WElement
impl OptionFromWasmAbi for WElement
Source§impl OptionIntoWasmAbi for WElement
impl OptionIntoWasmAbi for WElement
Source§impl RefFromWasmAbi for WElement
impl RefFromWasmAbi for WElement
Source§type Abi = WasmPtr<WasmRefCell<WElement>>
type Abi = WasmPtr<WasmRefCell<WElement>>
The Wasm ABI type references to
Self are recovered from.Source§impl RefMutFromWasmAbi for WElement
impl RefMutFromWasmAbi for WElement
impl SupportsConstructor for WElement
impl SupportsInstanceProperty for WElement
impl SupportsStaticProperty for WElement
Source§impl TryFromJsValue for WElement
impl TryFromJsValue for WElement
Source§impl VectorFromWasmAbi for WElement
impl VectorFromWasmAbi for WElement
Source§impl VectorIntoWasmAbi for WElement
impl VectorIntoWasmAbi for WElement
Auto Trait Implementations§
impl Freeze for WElement
impl RefUnwindSafe for WElement
impl Send for WElement
impl Sync for WElement
impl Unpin for WElement
impl UnsafeUnpin for WElement
impl UnwindSafe for WElement
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.