pub struct JsChangesStream { /* private fields */ }Expand description
JavaScript-friendly changes stream.
This provides the changes() API that yields the complete result set
whenever data changes. The callback receives the full current data,
not incremental changes - perfect for React’s setState pattern.
Implementations§
Source§impl JsChangesStream
impl JsChangesStream
Sourcepub fn subscribe(&self, callback: Function) -> Function
pub fn subscribe(&self, callback: Function) -> Function
Subscribes to the changes stream.
The callback receives the complete current result set as a JavaScript array.
It is called immediately with the initial data, and again whenever data changes.
Perfect for React: stream.subscribe(data => setUsers(data))
Returns an unsubscribe function.
Sourcepub fn get_result(&self) -> JsValue
pub fn get_result(&self) -> JsValue
Returns the current result.
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.
Trait Implementations§
Source§impl From<JsChangesStream> for JsValue
impl From<JsChangesStream> for JsValue
Source§fn from(value: JsChangesStream) -> Self
fn from(value: JsChangesStream) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for JsChangesStream
impl FromWasmAbi for JsChangesStream
Source§impl IntoWasmAbi for JsChangesStream
impl IntoWasmAbi for JsChangesStream
Source§impl LongRefFromWasmAbi for JsChangesStream
impl LongRefFromWasmAbi for JsChangesStream
Source§impl OptionFromWasmAbi for JsChangesStream
impl OptionFromWasmAbi for JsChangesStream
Source§impl OptionIntoWasmAbi for JsChangesStream
impl OptionIntoWasmAbi for JsChangesStream
Source§impl RefFromWasmAbi for JsChangesStream
impl RefFromWasmAbi for JsChangesStream
Source§type Anchor = RcRef<JsChangesStream>
type Anchor = RcRef<JsChangesStream>
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 RefMutFromWasmAbi for JsChangesStream
impl RefMutFromWasmAbi for JsChangesStream
Source§impl TryFromJsValue for JsChangesStream
impl TryFromJsValue for JsChangesStream
Source§impl VectorFromWasmAbi for JsChangesStream
impl VectorFromWasmAbi for JsChangesStream
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[JsChangesStream]>
Source§impl VectorIntoWasmAbi for JsChangesStream
impl VectorIntoWasmAbi for JsChangesStream
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[JsChangesStream]>) -> Self::Abi
Source§impl WasmDescribeVector for JsChangesStream
impl WasmDescribeVector for JsChangesStream
impl SupportsConstructor for JsChangesStream
impl SupportsInstanceProperty for JsChangesStream
impl SupportsStaticProperty for JsChangesStream
Auto Trait Implementations§
impl Freeze for JsChangesStream
impl !RefUnwindSafe for JsChangesStream
impl !Send for JsChangesStream
impl !Sync for JsChangesStream
impl Unpin for JsChangesStream
impl !UnwindSafe for JsChangesStream
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.