Enum leptos_use::core::ElementMaybeSignal
source · 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default 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