Struct leptos_use::UseEventSourceReturn
source · pub struct UseEventSourceReturn<T, Err, OpenFn, CloseFn>where
Err: 'static,
T: Clone + 'static,
OpenFn: Fn() + Clone + 'static,
CloseFn: Fn() + Clone + 'static,{
pub data: Signal<Option<T>>,
pub ready_state: Signal<ConnectionReadyState>,
pub event: Signal<Option<Event>>,
pub error: Signal<Option<UseEventSourceError<Err>>>,
pub open: OpenFn,
pub close: CloseFn,
pub event_source: Signal<Option<EventSource>>,
}
Expand description
Return type of use_event_source
.
Fields§
§data: Signal<Option<T>>
Latest data received via the EventSource
ready_state: Signal<ConnectionReadyState>
The current state of the connection,
event: Signal<Option<Event>>
The latest named event
error: Signal<Option<UseEventSourceError<Err>>>
The current error
open: OpenFn
(Re-)Opens the EventSource
connection
If the current one is active, will close it before opening a new one.
close: CloseFn
Closes the EventSource
connection
event_source: Signal<Option<EventSource>>
The EventSource
instance
Auto Trait Implementations§
impl<T, Err, OpenFn, CloseFn> Freeze for UseEventSourceReturn<T, Err, OpenFn, CloseFn>
impl<T, Err, OpenFn, CloseFn> !RefUnwindSafe for UseEventSourceReturn<T, Err, OpenFn, CloseFn>
impl<T, Err, OpenFn, CloseFn> !Send for UseEventSourceReturn<T, Err, OpenFn, CloseFn>
impl<T, Err, OpenFn, CloseFn> !Sync for UseEventSourceReturn<T, Err, OpenFn, CloseFn>
impl<T, Err, OpenFn, CloseFn> Unpin for UseEventSourceReturn<T, Err, OpenFn, CloseFn>
impl<T, Err, OpenFn, CloseFn> !UnwindSafe for UseEventSourceReturn<T, Err, OpenFn, CloseFn>
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> 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