Struct leptos::SyncCallback
source · pub struct SyncCallback<In, Out = ()>(/* private fields */)
where
In: 'static,
Out: 'static;
Expand description
A callback type that is Send
and Sync
if its input type is Send
and Sync
.
Otherwise, you can use exactly the way you use Callback
.
Implementations§
source§impl<In, Out> SyncCallback<In, Out>where
In: 'static,
Out: 'static,
impl<In, Out> SyncCallback<In, Out>where
In: 'static,
Out: 'static,
sourcepub fn new<F>(fun: F) -> SyncCallback<In, Out>where
F: Fn(In) -> Out + 'static,
pub fn new<F>(fun: F) -> SyncCallback<In, Out>where
F: Fn(In) -> Out + 'static,
Creates a new callback from the given function.
Trait Implementations§
source§impl<In, Out> Callable<In, Out> for SyncCallback<In, Out>
impl<In, Out> Callable<In, Out> for SyncCallback<In, Out>
source§impl<In, Out> Clone for SyncCallback<In, Out>
impl<In, Out> Clone for SyncCallback<In, Out>
source§fn clone(&self) -> SyncCallback<In, Out>
fn clone(&self) -> SyncCallback<In, Out>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<In> Debug for SyncCallback<In>
impl<In> Debug for SyncCallback<In>
source§impl<F, In, T, Out> From<F> for SyncCallback<In, Out>
impl<F, In, T, Out> From<F> for SyncCallback<In, Out>
source§fn from(f: F) -> SyncCallback<In, Out>
fn from(f: F) -> SyncCallback<In, Out>
Converts to this type from the input type.
Auto Trait Implementations§
impl<In, Out> Freeze for SyncCallback<In, Out>
impl<In, Out = ()> !RefUnwindSafe for SyncCallback<In, Out>
impl<In, Out = ()> !Send for SyncCallback<In, Out>
impl<In, Out = ()> !Sync for SyncCallback<In, Out>
impl<In, Out> Unpin for SyncCallback<In, Out>
impl<In, Out = ()> !UnwindSafe for SyncCallback<In, Out>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more