pub struct JsNullable<T>(/* private fields */);
Implementations§
Source§impl<T> JsNullable<T>where
T: JsCast,
impl<T> JsNullable<T>where
T: JsCast,
pub fn from_nonnull(value: T) -> JsNullable<T>
pub fn from_nonnull_ref(value: &T) -> &JsNullable<T>
pub fn unwrap(self) -> T
pub fn unwrap_ref(&self) -> &T
Methods from Deref<Target = JsValue>§
pub fn browser(&self) -> &Browser
Sourcepub fn retrieve_json(&self) -> RetrieveFuture<'_, Value>
pub fn retrieve_json(&self) -> RetrieveFuture<'_, Value>
Retrive this value from the JS side to the Rust side. Returns Future whose output is a serde_json::Value.
§use wsdom::dom::Browser
§use wsdom::dom::HTMLInputElement;
async fn example(input: &HTMLInputElement) { let _val = input.get_value().retrieve_json().await; }
Trait Implementations§
Source§impl<T> AsRef<JsNullable<T>> for JsNullable<T>
impl<T> AsRef<JsNullable<T>> for JsNullable<T>
Source§fn as_ref(&self) -> &JsNullable<T>
fn as_ref(&self) -> &JsNullable<T>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<T> AsRef<JsValue> for JsNullable<T>
impl<T> AsRef<JsValue> for JsNullable<T>
Source§impl<T> Clone for JsNullable<T>where
T: Clone,
impl<T> Clone for JsNullable<T>where
T: Clone,
Source§fn clone(&self) -> JsNullable<T>
fn clone(&self) -> JsNullable<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T> Deref for JsNullable<T>
impl<T> Deref for JsNullable<T>
Source§impl<T> Into<JsValue> for JsNullable<T>
impl<T> Into<JsValue> for JsNullable<T>
Source§impl<T> JsCast for JsNullable<T>
impl<T> JsCast for JsNullable<T>
fn unchecked_from_js(val: JsValue) -> JsNullable<T>
fn unchecked_from_js_ref(val: &JsValue) -> &JsNullable<T>
fn unchecked_into<T>(self) -> Twhere
T: JsCast,
fn unchecked_ref<T>(&self) -> &Twhere
T: JsCast,
Source§impl<T> RefCast for JsNullable<T>
impl<T> RefCast for JsNullable<T>
type From = JsValue
fn ref_cast(_from: &<JsNullable<T> as RefCast>::From) -> &JsNullable<T>
fn ref_cast_mut( _from: &mut <JsNullable<T> as RefCast>::From, ) -> &mut JsNullable<T>
Source§impl<T> UseInJsCode for JsNullable<T>
impl<T> UseInJsCode for JsNullable<T>
impl<'a, T, U> ToJs<JsNullable<T>> for Option<&'a U>
Auto Trait Implementations§
impl<T> Freeze for JsNullable<T>
impl<T> RefUnwindSafe for JsNullable<T>where
T: RefUnwindSafe,
impl<T> Send for JsNullable<T>where
T: Send,
impl<T> Sync for JsNullable<T>where
T: Sync,
impl<T> Unpin for JsNullable<T>where
T: Unpin,
impl<T> UnwindSafe for JsNullable<T>where
T: UnwindSafe,
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