mirror of
https://github.com/tauri-apps/web-view.git
synced 2026-02-04 02:11:18 +01:00
Implement clone manually
The Clone implementation for Handle does not need the T: Clone bound.
This commit is contained in:
committed by
Richard Hozák
parent
ad12815d2f
commit
4a8eb623a4
11
src/lib.rs
11
src/lib.rs
@@ -483,13 +483,22 @@ impl<'a, T> Drop for WebView<'a, T> {
|
||||
/// A thread-safe handle to a [`WebView`] instance. Used to dispatch closures onto its task queue.
|
||||
///
|
||||
/// [`WebView`]: struct.WebView.html
|
||||
#[derive(Clone)]
|
||||
pub struct Handle<T> {
|
||||
inner: *mut CWebView,
|
||||
live: Weak<RwLock<()>>,
|
||||
_phantom: PhantomData<T>,
|
||||
}
|
||||
|
||||
impl<T> Clone for Handle<T> {
|
||||
fn clone(&self) -> Self {
|
||||
Handle {
|
||||
inner: self.inner,
|
||||
live: self.live.clone(),
|
||||
_phantom: PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Handle<T> {
|
||||
/// Schedules a closure to be run on the [`WebView`] thread.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user