pub enum ElementMaybeSignal<T, E>{
Static(Option<T>),
Dynamic(Signal<Option<T>>),
_Phantom(PhantomData<E>),
}
Expand description
Used as an argument type to make it easily possible to pass either
- a
web_sys
element that implementsE
(for exampleEventTarget
,Element
orHtmlElement
), - an
Option<T>
whereT
is the web_sys element, - a
Signal<T>
whereT
is the web_sys element, - a
Signal<Option<T>>
whereT
is the web_sys element, - a
NodeRef
into a function. Used for example in crate::use_event_listener
.
Variants§
Trait Implementations§
Source§impl<T, E> Clone for ElementMaybeSignal<T, E>
impl<T, E> Clone for ElementMaybeSignal<T, E>
Source§impl<T, E> Default for ElementMaybeSignal<T, E>
impl<T, E> Default for ElementMaybeSignal<T, E>
Source§impl<T, E> From<ElementMaybeSignal<T, E>> for ElementsMaybeSignal<T, E>
impl<T, E> From<ElementMaybeSignal<T, E>> for ElementsMaybeSignal<T, E>
Source§fn from(signal: ElementMaybeSignal<T, E>) -> Self
fn from(signal: ElementMaybeSignal<T, E>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<HtmlElement<HtmlEl>> for ElementMaybeSignal<Element, Element>
impl<HtmlEl> From<HtmlElement<HtmlEl>> for ElementMaybeSignal<Element, Element>
Source§fn from(value: HtmlElement<HtmlEl>) -> Self
fn from(value: HtmlElement<HtmlEl>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<HtmlElement<HtmlEl>> for ElementMaybeSignal<EventTarget, EventTarget>
impl<HtmlEl> From<HtmlElement<HtmlEl>> for ElementMaybeSignal<EventTarget, EventTarget>
Source§fn from(value: HtmlElement<HtmlEl>) -> Self
fn from(value: HtmlElement<HtmlEl>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<HtmlElement<HtmlEl>> for ElementMaybeSignal<HtmlElement, HtmlElement>
impl<HtmlEl> From<HtmlElement<HtmlEl>> for ElementMaybeSignal<HtmlElement, HtmlElement>
Source§fn from(value: HtmlElement<HtmlEl>) -> Self
fn from(value: HtmlElement<HtmlEl>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<Memo<HtmlElement<HtmlEl>>> for ElementMaybeSignal<Element, Element>
impl<HtmlEl> From<Memo<HtmlElement<HtmlEl>>> for ElementMaybeSignal<Element, Element>
Source§fn from(value: Memo<HtmlElement<HtmlEl>>) -> Self
fn from(value: Memo<HtmlElement<HtmlEl>>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<Memo<HtmlElement<HtmlEl>>> for ElementMaybeSignal<EventTarget, EventTarget>
impl<HtmlEl> From<Memo<HtmlElement<HtmlEl>>> for ElementMaybeSignal<EventTarget, EventTarget>
Source§fn from(value: Memo<HtmlElement<HtmlEl>>) -> Self
fn from(value: Memo<HtmlElement<HtmlEl>>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<Memo<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<Element, Element>
impl<HtmlEl> From<Memo<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<Element, Element>
Source§impl<HtmlEl> From<Memo<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<EventTarget, EventTarget>
impl<HtmlEl> From<Memo<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<EventTarget, EventTarget>
Source§impl<HtmlEl> From<Memo<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<HtmlElement, HtmlElement>
impl<HtmlEl> From<Memo<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<HtmlElement, HtmlElement>
Source§impl<T, E> From<Memo<T>> for ElementMaybeSignal<T, E>
impl<T, E> From<Memo<T>> for ElementMaybeSignal<T, E>
Source§impl<R> From<NodeRef<R>> for ElementMaybeSignal<Element, Element>where
R: ElementDescriptor + Clone + 'static,
impl<R> From<NodeRef<R>> for ElementMaybeSignal<Element, Element>where
R: ElementDescriptor + Clone + 'static,
Source§impl<R> From<NodeRef<R>> for ElementMaybeSignal<EventTarget, EventTarget>where
R: ElementDescriptor + Clone + 'static,
impl<R> From<NodeRef<R>> for ElementMaybeSignal<EventTarget, EventTarget>where
R: ElementDescriptor + Clone + 'static,
Source§impl<R> From<NodeRef<R>> for ElementMaybeSignal<HtmlElement, HtmlElement>where
R: ElementDescriptor + Clone + 'static,
impl<R> From<NodeRef<R>> for ElementMaybeSignal<HtmlElement, HtmlElement>where
R: ElementDescriptor + Clone + 'static,
Source§impl<T, E> From<Option<T>> for ElementMaybeSignal<T, E>
impl<T, E> From<Option<T>> for ElementMaybeSignal<T, E>
Source§impl<E> From<ReadSignal<&str>> for ElementMaybeSignal<Element, E>
impl<E> From<ReadSignal<&str>> for ElementMaybeSignal<Element, E>
Source§fn from(signal: ReadSignal<&str>) -> Self
fn from(signal: ReadSignal<&str>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<ReadSignal<HtmlElement<HtmlEl>>> for ElementMaybeSignal<Element, Element>
impl<HtmlEl> From<ReadSignal<HtmlElement<HtmlEl>>> for ElementMaybeSignal<Element, Element>
Source§fn from(value: ReadSignal<HtmlElement<HtmlEl>>) -> Self
fn from(value: ReadSignal<HtmlElement<HtmlEl>>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<ReadSignal<HtmlElement<HtmlEl>>> for ElementMaybeSignal<EventTarget, EventTarget>
impl<HtmlEl> From<ReadSignal<HtmlElement<HtmlEl>>> for ElementMaybeSignal<EventTarget, EventTarget>
Source§fn from(value: ReadSignal<HtmlElement<HtmlEl>>) -> Self
fn from(value: ReadSignal<HtmlElement<HtmlEl>>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<ReadSignal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<Element, Element>
impl<HtmlEl> From<ReadSignal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<Element, Element>
Source§fn from(value: ReadSignal<Option<HtmlElement<HtmlEl>>>) -> Self
fn from(value: ReadSignal<Option<HtmlElement<HtmlEl>>>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<ReadSignal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<EventTarget, EventTarget>
impl<HtmlEl> From<ReadSignal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<EventTarget, EventTarget>
Source§fn from(value: ReadSignal<Option<HtmlElement<HtmlEl>>>) -> Self
fn from(value: ReadSignal<Option<HtmlElement<HtmlEl>>>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<ReadSignal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<HtmlElement, HtmlElement>
impl<HtmlEl> From<ReadSignal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<HtmlElement, HtmlElement>
Source§fn from(value: ReadSignal<Option<HtmlElement<HtmlEl>>>) -> Self
fn from(value: ReadSignal<Option<HtmlElement<HtmlEl>>>) -> Self
Converts to this type from the input type.
Source§impl<T, E> From<ReadSignal<Option<T>>> for ElementMaybeSignal<T, E>
impl<T, E> From<ReadSignal<Option<T>>> for ElementMaybeSignal<T, E>
Source§fn from(target: ReadSignal<Option<T>>) -> Self
fn from(target: ReadSignal<Option<T>>) -> Self
Converts to this type from the input type.
Source§impl<E> From<ReadSignal<String>> for ElementMaybeSignal<Element, E>
impl<E> From<ReadSignal<String>> for ElementMaybeSignal<Element, E>
Source§fn from(signal: ReadSignal<String>) -> Self
fn from(signal: ReadSignal<String>) -> Self
Converts to this type from the input type.
Source§impl<T, E> From<ReadSignal<T>> for ElementMaybeSignal<T, E>
impl<T, E> From<ReadSignal<T>> for ElementMaybeSignal<T, E>
Source§fn from(signal: ReadSignal<T>) -> Self
fn from(signal: ReadSignal<T>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<RwSignal<HtmlElement<HtmlEl>>> for ElementMaybeSignal<Element, Element>
impl<HtmlEl> From<RwSignal<HtmlElement<HtmlEl>>> for ElementMaybeSignal<Element, Element>
Source§fn from(value: RwSignal<HtmlElement<HtmlEl>>) -> Self
fn from(value: RwSignal<HtmlElement<HtmlEl>>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<RwSignal<HtmlElement<HtmlEl>>> for ElementMaybeSignal<EventTarget, EventTarget>
impl<HtmlEl> From<RwSignal<HtmlElement<HtmlEl>>> for ElementMaybeSignal<EventTarget, EventTarget>
Source§fn from(value: RwSignal<HtmlElement<HtmlEl>>) -> Self
fn from(value: RwSignal<HtmlElement<HtmlEl>>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<RwSignal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<Element, Element>
impl<HtmlEl> From<RwSignal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<Element, Element>
Source§impl<HtmlEl> From<RwSignal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<EventTarget, EventTarget>
impl<HtmlEl> From<RwSignal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<EventTarget, EventTarget>
Source§impl<HtmlEl> From<RwSignal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<HtmlElement, HtmlElement>
impl<HtmlEl> From<RwSignal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<HtmlElement, HtmlElement>
Source§impl<T, E> From<RwSignal<T>> for ElementMaybeSignal<T, E>
impl<T, E> From<RwSignal<T>> for ElementMaybeSignal<T, E>
Source§impl<HtmlEl> From<Signal<HtmlElement<HtmlEl>>> for ElementMaybeSignal<Element, Element>
impl<HtmlEl> From<Signal<HtmlElement<HtmlEl>>> for ElementMaybeSignal<Element, Element>
Source§fn from(value: Signal<HtmlElement<HtmlEl>>) -> Self
fn from(value: Signal<HtmlElement<HtmlEl>>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<Signal<HtmlElement<HtmlEl>>> for ElementMaybeSignal<EventTarget, EventTarget>
impl<HtmlEl> From<Signal<HtmlElement<HtmlEl>>> for ElementMaybeSignal<EventTarget, EventTarget>
Source§fn from(value: Signal<HtmlElement<HtmlEl>>) -> Self
fn from(value: Signal<HtmlElement<HtmlEl>>) -> Self
Converts to this type from the input type.
Source§impl<HtmlEl> From<Signal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<Element, Element>
impl<HtmlEl> From<Signal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<Element, Element>
Source§impl<HtmlEl> From<Signal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<EventTarget, EventTarget>
impl<HtmlEl> From<Signal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<EventTarget, EventTarget>
Source§impl<HtmlEl> From<Signal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<HtmlElement, HtmlElement>
impl<HtmlEl> From<Signal<Option<HtmlElement<HtmlEl>>>> for ElementMaybeSignal<HtmlElement, HtmlElement>
Source§impl<T, E> From<Signal<T>> for ElementMaybeSignal<T, E>
impl<T, E> From<Signal<T>> for ElementMaybeSignal<T, E>
Source§impl<T, E> From<T> for ElementMaybeSignal<T, E>
impl<T, E> From<T> for ElementMaybeSignal<T, E>
Source§impl<E> From<UseDocument> for ElementMaybeSignal<Document, E>
impl<E> From<UseDocument> for ElementMaybeSignal<Document, E>
Source§fn from(value: UseDocument) -> Self
fn from(value: UseDocument) -> Self
Converts to this type from the input type.
Source§impl<T, E> SignalGet for ElementMaybeSignal<T, E>
impl<T, E> SignalGet for ElementMaybeSignal<T, E>
Source§impl<T, E> SignalGetUntracked for ElementMaybeSignal<T, E>
impl<T, E> SignalGetUntracked for ElementMaybeSignal<T, E>
Source§fn get_untracked(&self) -> Option<T>
fn get_untracked(&self) -> Option<T>
Gets the signal’s value without creating a dependency on the
current scope. Read more
Source§impl<T, E> SignalWith for ElementMaybeSignal<T, E>
impl<T, E> SignalWith for ElementMaybeSignal<T, E>
Source§impl<T, E> SignalWithUntracked for ElementMaybeSignal<T, E>
impl<T, E> SignalWithUntracked for ElementMaybeSignal<T, E>
Auto Trait Implementations§
impl<T, E> Freeze for ElementMaybeSignal<T, E>where
T: Freeze,
impl<T, E> !RefUnwindSafe for ElementMaybeSignal<T, E>
impl<T, E> !Send for ElementMaybeSignal<T, E>
impl<T, E> !Sync for ElementMaybeSignal<T, E>
impl<T, E> Unpin for ElementMaybeSignal<T, E>
impl<T, E> !UnwindSafe for ElementMaybeSignal<T, E>
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§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