pub struct WDocument(/* private fields */);Available on crate feature
wasm only.Expand description
A complete HTML document, usable from JavaScript.
Implementations§
Source§impl WDocument
impl WDocument
Sourcepub fn new(lang: Option<String>) -> Self
pub fn new(lang: Option<String>) -> Self
Creates a document. Pass null for lang to omit the attribute.
Sourcepub fn render(&self) -> String
pub fn render(&self) -> String
Renders the document, pretty-printed and prefixed by the doctype.
Sourcepub fn render_compact(&self) -> String
pub fn render_compact(&self) -> String
Renders the document on a single line.
Sourcepub fn render_with_indent(&self, indent: &str) -> String
pub fn render_with_indent(&self, indent: &str) -> String
Renders with a custom indent string.
Trait Implementations§
Source§impl FromWasmAbi for WDocument
impl FromWasmAbi for WDocument
Source§impl IntoWasmAbi for WDocument
impl IntoWasmAbi for WDocument
Source§impl LongRefFromWasmAbi for WDocument
impl LongRefFromWasmAbi for WDocument
Source§impl OptionFromWasmAbi for WDocument
impl OptionFromWasmAbi for WDocument
Source§impl OptionIntoWasmAbi for WDocument
impl OptionIntoWasmAbi for WDocument
Source§impl RefFromWasmAbi for WDocument
impl RefFromWasmAbi for WDocument
Source§type Abi = WasmPtr<WasmRefCell<WDocument>>
type Abi = WasmPtr<WasmRefCell<WDocument>>
The Wasm ABI type references to
Self are recovered from.Source§impl RefMutFromWasmAbi for WDocument
impl RefMutFromWasmAbi for WDocument
impl SupportsConstructor for WDocument
impl SupportsInstanceProperty for WDocument
impl SupportsStaticProperty for WDocument
Source§impl TryFromJsValue for WDocument
impl TryFromJsValue for WDocument
Source§impl VectorFromWasmAbi for WDocument
impl VectorFromWasmAbi for WDocument
Source§impl VectorIntoWasmAbi for WDocument
impl VectorIntoWasmAbi for WDocument
Auto Trait Implementations§
impl Freeze for WDocument
impl RefUnwindSafe for WDocument
impl Send for WDocument
impl Sync for WDocument
impl Unpin for WDocument
impl UnsafeUnpin for WDocument
impl UnwindSafe for WDocument
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.