pub struct UseBroadcastChannelReturn<T, PFn, CFn, C>where
T: Send + Sync + 'static,
PFn: Fn(&T) + Clone,
CFn: Fn() + Clone,
C: Encoder<T> + Decoder<T> + Send + Sync,{
pub is_supported: Signal<bool>,
pub channel: OptionLocalSignal<BroadcastChannel>,
pub message: Signal<Option<T>>,
pub post: PFn,
pub close: CFn,
pub error: OptionLocalSignal<UseBroadcastChannelError<<C as Encoder<T>>::Error, <C as Decoder<T>>::Error>>,
pub is_closed: Signal<bool>,
}Expand description
Return type of use_broadcast_channel.
Fields§
§is_supported: Signal<bool>true if this browser supports BroadcastChannels.
channel: OptionLocalSignal<BroadcastChannel>The broadcast channel that is wrapped by this function
message: Signal<Option<T>>Latest message received from the channel
post: PFnSends a message through the channel
close: CFnCloses the channel
error: OptionLocalSignal<UseBroadcastChannelError<<C as Encoder<T>>::Error, <C as Decoder<T>>::Error>>Latest error as reported by the messageerror event.
is_closed: Signal<bool>Wether the channel is closed
Auto Trait Implementations§
impl<T, PFn, CFn, C> Freeze for UseBroadcastChannelReturn<T, PFn, CFn, C>
impl<T, PFn, CFn, C> RefUnwindSafe for UseBroadcastChannelReturn<T, PFn, CFn, C>where
Signal<Option<T>>: RefUnwindSafe,
PFn: RefUnwindSafe,
CFn: RefUnwindSafe,
OptionLocalSignal<UseBroadcastChannelError<<C as Encoder<T>>::Error, <C as Decoder<T>>::Error>>: RefUnwindSafe,
impl<T, PFn, CFn, C> Send for UseBroadcastChannelReturn<T, PFn, CFn, C>
impl<T, PFn, CFn, C> Sync for UseBroadcastChannelReturn<T, PFn, CFn, C>
impl<T, PFn, CFn, C> Unpin for UseBroadcastChannelReturn<T, PFn, CFn, C>
impl<T, PFn, CFn, C> UnsafeUnpin for UseBroadcastChannelReturn<T, PFn, CFn, C>where
Signal<Option<T>>: UnsafeUnpin,
PFn: UnsafeUnpin,
CFn: UnsafeUnpin,
OptionLocalSignal<UseBroadcastChannelError<<C as Encoder<T>>::Error, <C as Decoder<T>>::Error>>: UnsafeUnpin,
impl<T, PFn, CFn, C> UnwindSafe for UseBroadcastChannelReturn<T, PFn, CFn, C>where
Signal<Option<T>>: UnwindSafe,
PFn: UnwindSafe,
CFn: UnwindSafe,
OptionLocalSignal<UseBroadcastChannelError<<C as Encoder<T>>::Error, <C as Decoder<T>>::Error>>: UnwindSafe,
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> 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 moreSource§impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for Elwhere
El: IntoElementMaybeSignalType<T, Marker>,
impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for Elwhere
El: IntoElementMaybeSignalType<T, Marker>,
fn into_element_maybe_signal(self) -> ElementMaybeSignal<T>
Source§impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
fn into_element_maybe_signal_type(self) -> ElementMaybeSignalType<T>
Source§impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for Elwhere
El: IntoElementsMaybeSignalType<T, Marker>,
impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for Elwhere
El: IntoElementsMaybeSignalType<T, Marker>,
fn into_elements_maybe_signal(self) -> ElementsMaybeSignal<T>
Source§impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
fn into_elements_maybe_signal_type(self) -> ElementsMaybeSignalType<T>
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.