pub struct WatcherGuard { /* private fields */ }Expand description
Unified RAII lifecycle guard for active JavaScript/browser watchers.
Dropping this guard automatically cancels the asynchronous event receiver task
and dispatches a browser-side teardown RPC to unregister the underlying observer
(disconnect(), removeEventListener(), etc.).
Implementations§
Source§impl WatcherGuard
impl WatcherGuard
Sourcepub fn new(name: &'static str, sub_id: u64, task: Option<Task>) -> Self
pub fn new(name: &'static str, sub_id: u64, task: Option<Task>) -> Self
Creates a new WatcherGuard with the given diagnostic name, subscription ID, and optional background task.
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Returns the static diagnostic name of the watcher (e.g. "watch_resize").
Sourcepub fn subscription_id(&self) -> u64
pub fn subscription_id(&self) -> u64
Returns the unique subscription ID assigned to this watcher.
Trait Implementations§
Source§impl Debug for WatcherGuard
impl Debug for WatcherGuard
Source§impl Drop for WatcherGuard
impl Drop for WatcherGuard
Auto Trait Implementations§
impl !Send for WatcherGuard
impl !Sync for WatcherGuard
impl Freeze for WatcherGuard
impl RefUnwindSafe for WatcherGuard
impl Unpin for WatcherGuard
impl UnsafeUnpin for WatcherGuard
impl UnwindSafe for WatcherGuard
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> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.