#[repr(transparent)]pub struct RawJsAutotypeRenderDriver {
obj: JsValue,
}Expand description
JavaScript implementation of the Autotype operations applied in the render process.
Fields§
§obj: JsValueImplementations§
Source§impl RawJsAutotypeRenderDriver
impl RawJsAutotypeRenderDriver
Sourceasync fn get_autotype_credentials(
&self,
app: AutotypeRunningApp,
) -> Result<JsValue, JsValue>
async fn get_autotype_credentials( &self, app: AutotypeRunningApp, ) -> Result<JsValue, JsValue>
Find the credentials to autotype into the focused app, as requested by the main process.
The driver returns an AutotypeCredentials or undefined, received here as a raw
JsValue so JsAutotypeRenderDriver::get_autotype_credentials can reject malformed
credentials.
Methods from Deref<Target = JsValue>§
pub const NULL: JsValue
pub const UNDEFINED: JsValue
pub const TRUE: JsValue
pub const FALSE: JsValue
Sourcepub fn into_serde<T>(&self) -> Result<T, Error>where
T: for<'a> Deserialize<'a>,
👎Deprecated: causes dependency cycles, use serde-wasm-bindgen or gloo_utils::format::JsValueSerdeExt instead
pub fn into_serde<T>(&self) -> Result<T, Error>where
T: for<'a> Deserialize<'a>,
causes dependency cycles, use serde-wasm-bindgen or gloo_utils::format::JsValueSerdeExt instead
Invokes JSON.stringify on this value and then parses the resulting
JSON into an arbitrary Rust value.
This function is deprecated, due to creating a dependency cycle in
some circumstances. Use serde-wasm-bindgen or
gloo_utils::format::JsValueSerdeExt instead.
This function will first call JSON.stringify on the JsValue itself.
The resulting string is then passed into Rust which then parses it as
JSON into the resulting value.
Usage of this API requires activating the serde-serialize feature of
the wasm-bindgen crate.
§Errors
Returns any error encountered when parsing the JSON into a T.
Sourcepub fn as_f64(&self) -> Option<f64>
pub fn as_f64(&self) -> Option<f64>
Returns the f64 value of this JS value if it’s an instance of a
number.
If this JS value is not an instance of a number then this returns
None.
Sourcepub fn as_string(&self) -> Option<String>
pub fn as_string(&self) -> Option<String>
If this JS value is a string value, this function copies the JS string
value into Wasm linear memory, encoded as UTF-8, and returns it as a
Rust String.
To avoid the copying and re-encoding, consider the
JsString::try_from() function from js-sys
instead.
If this JS value is not an instance of a string or if it’s not valid
utf-8 then this returns None.
§UTF-16 vs UTF-8
JavaScript strings in general are encoded as UTF-16, but Rust strings
are encoded as UTF-8. This can cause the Rust string to look a bit
different than the JS string sometimes. For more details see the
documentation about the str type which contains a few
caveats about the encodings.
Sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
Returns the bool value of this JS value if it’s an instance of a
boolean.
If this JS value is not an instance of a boolean then this returns
None.
Sourcepub fn is_undefined(&self) -> bool
pub fn is_undefined(&self) -> bool
Tests whether this JS value is undefined
Sourcepub fn is_null_or_undefined(&self) -> bool
pub fn is_null_or_undefined(&self) -> bool
Tests whether this JS value is null or undefined
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Tests whether the type of this JS value is function.
Sourcepub fn js_in(&self, obj: &JsValue) -> bool
pub fn js_in(&self, obj: &JsValue) -> bool
Applies the binary in JS operator on the two JsValues.
Sourcepub fn loose_eq(&self, other: &JsValue) -> bool
pub fn loose_eq(&self, other: &JsValue) -> bool
Compare two JsValues for equality, using the == operator in JS.
Sourcepub fn unsigned_shr(&self, rhs: &JsValue) -> u32
pub fn unsigned_shr(&self, rhs: &JsValue) -> u32
Applies the binary >>> JS operator on the two JsValues.
Sourcepub fn checked_div(&self, rhs: &JsValue) -> JsValue
pub fn checked_div(&self, rhs: &JsValue) -> JsValue
Applies the binary / JS operator on two JsValues, catching and returning any RangeError thrown.
Sourcepub fn pow(&self, rhs: &JsValue) -> JsValue
pub fn pow(&self, rhs: &JsValue) -> JsValue
Applies the binary ** JS operator on the two JsValues.
Sourcepub fn lt(&self, other: &JsValue) -> bool
pub fn lt(&self, other: &JsValue) -> bool
Applies the binary < JS operator on the two JsValues.
Sourcepub fn le(&self, other: &JsValue) -> bool
pub fn le(&self, other: &JsValue) -> bool
Applies the binary <= JS operator on the two JsValues.
Sourcepub fn ge(&self, other: &JsValue) -> bool
pub fn ge(&self, other: &JsValue) -> bool
Applies the binary >= JS operator on the two JsValues.
Sourcepub fn gt(&self, other: &JsValue) -> bool
pub fn gt(&self, other: &JsValue) -> bool
Applies the binary > JS operator on the two JsValues.
Sourcepub fn unchecked_into_f64(&self) -> f64
pub fn unchecked_into_f64(&self) -> f64
Applies the unary + JS operator on a JsValue. Can throw.
Trait Implementations§
Source§impl AsRef<JsValue> for RawJsAutotypeRenderDriver
impl AsRef<JsValue> for RawJsAutotypeRenderDriver
Source§impl AsRef<RawJsAutotypeRenderDriver> for RawJsAutotypeRenderDriver
impl AsRef<RawJsAutotypeRenderDriver> for RawJsAutotypeRenderDriver
Source§fn as_ref(&self) -> &RawJsAutotypeRenderDriver
fn as_ref(&self) -> &RawJsAutotypeRenderDriver
Source§impl Deref for RawJsAutotypeRenderDriver
impl Deref for RawJsAutotypeRenderDriver
Source§impl From<JsValue> for RawJsAutotypeRenderDriver
impl From<JsValue> for RawJsAutotypeRenderDriver
Source§impl From<RawJsAutotypeRenderDriver> for JsValue
impl From<RawJsAutotypeRenderDriver> for JsValue
Source§fn from(obj: RawJsAutotypeRenderDriver) -> JsValue
fn from(obj: RawJsAutotypeRenderDriver) -> JsValue
Source§impl FromWasm for RawJsAutotypeRenderDriver
Available on crate feature wasm only.
impl FromWasm for RawJsAutotypeRenderDriver
wasm only.Source§impl IntoJsGeneric for RawJsAutotypeRenderDriverwhere
RawJsAutotypeRenderDriver: JsGeneric,
impl IntoJsGeneric for RawJsAutotypeRenderDriverwhere
RawJsAutotypeRenderDriver: JsGeneric,
Source§type JsCanon = RawJsAutotypeRenderDriver
type JsCanon = RawJsAutotypeRenderDriver
JsGeneric form of this type.Source§fn to_js(self) -> RawJsAutotypeRenderDriver
fn to_js(self) -> RawJsAutotypeRenderDriver
JsGeneric value for self.Source§impl<'__wbg_ref> IntoWasmAbi for &'__wbg_ref RawJsAutotypeRenderDriver
impl<'__wbg_ref> IntoWasmAbi for &'__wbg_ref RawJsAutotypeRenderDriver
Source§impl JsCast for RawJsAutotypeRenderDriver
impl JsCast for RawJsAutotypeRenderDriver
Source§fn instanceof(val: &JsValue) -> bool
fn instanceof(val: &JsValue) -> bool
instanceof check to see whether the JsValue
provided is an instance of this type. Read moreSource§fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js(val: JsValue) -> Self
Source§fn unchecked_from_js_ref(val: &JsValue) -> &Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self
Source§fn has_type<T>(&self) -> boolwhere
T: JsCast,
fn has_type<T>(&self) -> boolwhere
T: JsCast,
T. Read moreSource§fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
T. Read moreSource§fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
T. Read moreSource§fn unchecked_into<T>(self) -> Twhere
T: JsCast,
fn unchecked_into<T>(self) -> Twhere
T: JsCast,
Source§fn unchecked_ref<T>(&self) -> &Twhere
T: JsCast,
fn unchecked_ref<T>(&self) -> &Twhere
T: JsCast,
Source§impl LongRefFromWasmAbi for RawJsAutotypeRenderDriver
impl LongRefFromWasmAbi for RawJsAutotypeRenderDriver
Source§type Anchor = RawJsAutotypeRenderDriver
type Anchor = RawJsAutotypeRenderDriver
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
RefFromWasmAbi::ref_from_abiSource§impl<'__wbg_ref> NullableIntoWasmAbi for &'__wbg_ref RawJsAutotypeRenderDriver
impl<'__wbg_ref> NullableIntoWasmAbi for &'__wbg_ref RawJsAutotypeRenderDriver
Source§impl<'__wbg_ref> OptionIntoWasmAbi for &'__wbg_ref RawJsAutotypeRenderDriver
impl<'__wbg_ref> OptionIntoWasmAbi for &'__wbg_ref RawJsAutotypeRenderDriver
Source§impl Promising for RawJsAutotypeRenderDriver
impl Promising for RawJsAutotypeRenderDriver
Source§type Resolution = RawJsAutotypeRenderDriver
type Resolution = RawJsAutotypeRenderDriver
Source§impl RefFromWasmAbi for RawJsAutotypeRenderDriver
impl RefFromWasmAbi for RawJsAutotypeRenderDriver
Source§type Abi = <JsValue as RefFromWasmAbi>::Abi
type Abi = <JsValue as RefFromWasmAbi>::Abi
Self are recovered from.Source§type Anchor = ManuallyDrop<RawJsAutotypeRenderDriver>
type Anchor = ManuallyDrop<RawJsAutotypeRenderDriver>
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl ToWasm for RawJsAutotypeRenderDriver
Available on crate feature wasm only.
impl ToWasm for RawJsAutotypeRenderDriver
wasm only.impl UpcastFrom<RawJsAutotypeRenderDriver> for JsValue
impl UpcastFrom<RawJsAutotypeRenderDriver> for JsOption<JsValue>
impl UpcastFrom<RawJsAutotypeRenderDriver> for JsNullable<JsValue>
impl<__UpcastWrapTarget> UpcastFrom<RawJsAutotypeRenderDriver> for Option<__UpcastWrapTarget>where
__UpcastWrapTarget: UpcastFrom<RawJsAutotypeRenderDriver>,
impl<__UpcastWrapTarget> UpcastFrom<RawJsAutotypeRenderDriver> for Nullable<__UpcastWrapTarget>where
__UpcastWrapTarget: UpcastFrom<RawJsAutotypeRenderDriver>,
impl UpcastFrom<RawJsAutotypeRenderDriver> for RawJsAutotypeRenderDriver
impl UpcastFrom<RawJsAutotypeRenderDriver> for JsOption<RawJsAutotypeRenderDriver>
impl UpcastFrom<RawJsAutotypeRenderDriver> for JsNullable<RawJsAutotypeRenderDriver>
Source§impl VectorRefIntoWasmAbi for RawJsAutotypeRenderDriver
impl VectorRefIntoWasmAbi for RawJsAutotypeRenderDriver
fn slice_into_abi(slice: &[Self]) -> WasmSlice
impl VectorRefIntoWasmAbiSealed for RawJsAutotypeRenderDriver
Auto Trait Implementations§
impl Freeze for RawJsAutotypeRenderDriver
impl RefUnwindSafe for RawJsAutotypeRenderDriver
impl Send for RawJsAutotypeRenderDriver
impl Sync for RawJsAutotypeRenderDriver
impl Unpin for RawJsAutotypeRenderDriver
impl UnsafeUnpin for RawJsAutotypeRenderDriver
impl UnwindSafe for RawJsAutotypeRenderDriver
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> JsGeneric for T
Source§impl<T> MaybeFromWasmAbi for Twhere
T: OptionFromWasmAbi,
impl<T> MaybeFromWasmAbi for Twhere
T: OptionFromWasmAbi,
Source§type MaybeAbi = <T as FromWasmAbi>::Abi
type MaybeAbi = <T as FromWasmAbi>::Abi
Option<Self>.Source§unsafe fn from_maybe_abi(js: <T as FromWasmAbi>::Abi) -> T
unsafe fn from_maybe_abi(js: <T as FromWasmAbi>::Abi) -> T
unsafe fn try_from_maybe_abi( js: <T as FromWasmAbi>::Abi, ) -> Result<T, &'static str>
Source§impl<T> MaybeIntoWasmAbi for Twhere
T: OptionIntoWasmAbi,
impl<T> MaybeIntoWasmAbi for Twhere
T: OptionIntoWasmAbi,
Source§type MaybeAbi = <T as IntoWasmAbi>::Abi
type MaybeAbi = <T as IntoWasmAbi>::Abi
Option<Self>.Source§fn into_maybe_abi(self) -> <T as IntoWasmAbi>::Abi
fn into_maybe_abi(self) -> <T as IntoWasmAbi>::Abi
Option<Self> ABI.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, A> RefIntoWasmAbi for T
impl<T, A> RefIntoWasmAbi for T
Source§fn describe_ref()
fn describe_ref()
&Self.Source§fn ref_into_abi(&self) -> A
fn ref_into_abi(&self) -> A
&self into Self::Abi.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
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.Source§impl<T> TryFromJsValue for Twhere
T: JsCast,
impl<T> TryFromJsValue for Twhere
T: JsCast,
Source§fn try_from_js_value_ref(val: &JsValue) -> Option<T>
fn try_from_js_value_ref(val: &JsValue) -> Option<T>
Source§const NULLABLE: bool = false
const NULLABLE: bool = false
Self accepts null as a distinct value space, as
Nullable<T> does. An enclosing Option then passes null through
instead of reading it as None, so Option<T> is itself nullable
exactly when T is not. JsValue does not set this: it accepts
null as one value among all of them, not as a distinct space, and
Option<JsValue> reads it as None like the ABI does. This is the
JS-value side of NullableFromWasmAbi, which claims null at the
ABI.