pub struct JsObservableQuery { /* private fields */ }Expand description
JavaScript-friendly observable query wrapper. Uses re-query strategy for optimal performance with indexes.
Implementations§
Source§impl JsObservableQuery
impl JsObservableQuery
Sourcepub fn subscribe(&mut self, callback: Function) -> Function
pub fn subscribe(&mut self, callback: Function) -> Function
Subscribes to query changes.
The callback receives the complete current result set as a JavaScript array. It is called whenever data changes (not immediately - use getResult for initial data). Returns an unsubscribe function.
Sourcepub fn get_result(&self) -> JsValue
pub fn get_result(&self) -> JsValue
Returns the current result as a JavaScript array.
Sourcepub fn get_result_binary(&self) -> BinaryResult
pub fn get_result_binary(&self) -> BinaryResult
Returns the current result as a binary buffer for zero-copy access.
Sourcepub fn get_schema_layout(&self) -> SchemaLayout
pub fn get_schema_layout(&self) -> SchemaLayout
Returns the schema layout for decoding binary results.
Sourcepub fn subscription_count(&self) -> usize
pub fn subscription_count(&self) -> usize
Returns the number of active subscriptions.
Trait Implementations§
Source§impl From<JsObservableQuery> for JsValue
impl From<JsObservableQuery> for JsValue
Source§fn from(value: JsObservableQuery) -> Self
fn from(value: JsObservableQuery) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for JsObservableQuery
impl FromWasmAbi for JsObservableQuery
Source§impl IntoWasmAbi for JsObservableQuery
impl IntoWasmAbi for JsObservableQuery
Source§impl RefFromWasmAbi for JsObservableQuery
impl RefFromWasmAbi for JsObservableQuery
Source§type Anchor = RcRef<JsObservableQuery>
type Anchor = RcRef<JsObservableQuery>
The type that holds the reference to
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 TryFromJsValue for JsObservableQuery
impl TryFromJsValue for JsObservableQuery
Source§impl VectorFromWasmAbi for JsObservableQuery
impl VectorFromWasmAbi for JsObservableQuery
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[JsObservableQuery]>
Source§impl VectorIntoWasmAbi for JsObservableQuery
impl VectorIntoWasmAbi for JsObservableQuery
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[JsObservableQuery]>) -> Self::Abi
Source§impl WasmDescribeVector for JsObservableQuery
impl WasmDescribeVector for JsObservableQuery
impl SupportsConstructor for JsObservableQuery
impl SupportsInstanceProperty for JsObservableQuery
impl SupportsStaticProperty for JsObservableQuery
Auto Trait Implementations§
impl Freeze for JsObservableQuery
impl !RefUnwindSafe for JsObservableQuery
impl !Send for JsObservableQuery
impl !Sync for JsObservableQuery
impl Unpin for JsObservableQuery
impl !UnwindSafe for JsObservableQuery
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> 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.