Skip to main content

MaybeProp

Struct MaybeProp 

Source
pub struct MaybeProp<T, S = SyncStorage>(/* private fields */)
where
    T: 'static,
    S: Storage<Option<T>> + Storage<SignalTypes<Option<T>, S>>;
Expand description

A wrapping type for an optional component prop.

This can either be a signal or a non-reactive value, and may or may not have a value. In other words, this is an Option<Signal<Option<T>>>, but automatically flattens its getters.

This creates an extremely flexible type for component libraries, etc.

§Examples

let (count, set_count) = signal(Some(2));
let double = |n| n * 2;
let double_count = MaybeProp::derive(move || count.get().map(double));
let memoized_double_count = Memo::new(move |_| count.get().map(double));
let static_value = 5;

// this function takes either a reactive or non-reactive value
fn above_3(arg: &MaybeProp<i32>) -> bool {
    // ✅ calling the signal clones and returns the value
    //    it is a shorthand for arg.get()q
    arg.get().map(|arg| arg > 3).unwrap_or(false)
}

assert_eq!(above_3(&None::<i32>.into()), false);
assert_eq!(above_3(&static_value.into()), true);
assert_eq!(above_3(&count.into()), false);
assert_eq!(above_3(&double_count), true);
assert_eq!(above_3(&memoized_double_count.into()), true);

Implementations§

Source§

impl<T> MaybeProp<T>
where T: Send + Sync,

Source

pub fn derive( derived_signal: impl Fn() -> Option<T> + Send + Sync + 'static, ) -> MaybeProp<T>

Wraps a derived signal, i.e., any computation that accesses one or more reactive signals.

Source§

impl<T> MaybeProp<T, LocalStorage>

Source

pub fn derive_local( derived_signal: impl Fn() -> Option<T> + 'static, ) -> MaybeProp<T, LocalStorage>

Wraps a derived signal, i.e., any computation that accesses one or more reactive signals.

Trait Implementations§

Source§

impl<T, S> Clone for MaybeProp<T, S>
where S: Storage<Option<T>> + Storage<SignalTypes<Option<T>, S>>,

Source§

fn clone(&self) -> MaybeProp<T, S>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T, S> Copy for MaybeProp<T, S>
where S: Storage<Option<T>> + Storage<SignalTypes<Option<T>, S>>,

Source§

impl<T, S> Debug for MaybeProp<T, S>
where T: Debug + 'static, S: Debug + Storage<Option<T>> + Storage<SignalTypes<Option<T>, S>>,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T, S> Default for MaybeProp<T, S>
where S: Storage<Option<T>> + Storage<SignalTypes<Option<T>, S>>,

Source§

fn default() -> MaybeProp<T, S>

Returns the “default value” for a type. Read more
Source§

impl<T, S> DefinedAt for MaybeProp<T, S>
where S: Storage<Option<T>> + Storage<SignalTypes<Option<T>, S>>,

Source§

fn defined_at(&self) -> Option<&'static Location<'static>>

Returns the location at which the signal was defined. This is usually simply None in release mode.
Source§

impl<T, S> Eq for MaybeProp<T, S>
where T: Eq + 'static, S: Eq + Storage<Option<T>> + Storage<SignalTypes<Option<T>, S>>,

Source§

impl From<&str> for MaybeProp<String>

Source§

fn from(value: &str) -> MaybeProp<String>

Converts to this type from the input type.
Source§

impl From<&str> for MaybeProp<String, LocalStorage>

Source§

fn from(value: &str) -> MaybeProp<String, LocalStorage>

Converts to this type from the input type.
Source§

impl<T> From<MaybeProp<T, LocalStorage>> for Option<Signal<Option<T>, LocalStorage>>
where T: Send + Sync + 'static,

Source§

fn from( value: MaybeProp<T, LocalStorage>, ) -> Option<Signal<Option<T>, LocalStorage>>

Converts to this type from the input type.
Source§

impl<T> From<MaybeProp<T>> for Option<Signal<Option<T>>>
where T: Send + Sync + 'static,

Source§

fn from(value: MaybeProp<T>) -> Option<Signal<Option<T>>>

Converts to this type from the input type.
Source§

impl<T> From<MaybeSignal<Option<T>, LocalStorage>> for MaybeProp<T, LocalStorage>
where T: Send + Sync,

Source§

fn from( value: MaybeSignal<Option<T>, LocalStorage>, ) -> MaybeProp<T, LocalStorage>

Converts to this type from the input type.
Source§

impl<T> From<MaybeSignal<Option<T>>> for MaybeProp<T>
where T: Send + Sync, SyncStorage: Storage<Option<T>>,

Source§

fn from(value: MaybeSignal<Option<T>>) -> MaybeProp<T>

Converts to this type from the input type.
Source§

impl<T> From<Memo<Option<T>, LocalStorage>> for MaybeProp<T, LocalStorage>
where T: Send + Sync,

Source§

fn from(value: Memo<Option<T>, LocalStorage>) -> MaybeProp<T, LocalStorage>

Converts to this type from the input type.
Source§

impl<T> From<Memo<Option<T>>> for MaybeProp<T>
where T: Send + Sync,

Source§

fn from(value: Memo<Option<T>>) -> MaybeProp<T>

Converts to this type from the input type.
Source§

impl<T> From<Memo<T, LocalStorage>> for MaybeProp<T, LocalStorage>
where T: Send + Sync + Clone,

Source§

fn from(value: Memo<T, LocalStorage>) -> MaybeProp<T, LocalStorage>

Converts to this type from the input type.
Source§

impl<T> From<Memo<T>> for MaybeProp<T>
where T: Send + Sync + Clone,

Source§

fn from(value: Memo<T>) -> MaybeProp<T>

Converts to this type from the input type.
Source§

impl<T> From<Option<MaybeSignal<Option<T>, LocalStorage>>> for MaybeProp<T, LocalStorage>
where T: Send + Sync,

Source§

fn from( value: Option<MaybeSignal<Option<T>, LocalStorage>>, ) -> MaybeProp<T, LocalStorage>

Converts to this type from the input type.
Source§

impl<T> From<Option<MaybeSignal<Option<T>>>> for MaybeProp<T>
where T: Send + Sync, SyncStorage: Storage<Option<T>>,

Source§

fn from(value: Option<MaybeSignal<Option<T>>>) -> MaybeProp<T>

Converts to this type from the input type.
Source§

impl<T> From<Option<T>> for MaybeProp<T>
where T: Send + Sync, SyncStorage: Storage<Option<T>>,

Source§

fn from(value: Option<T>) -> MaybeProp<T>

Converts to this type from the input type.
Source§

impl<T> From<ReadSignal<Option<T>, LocalStorage>> for MaybeProp<T, LocalStorage>
where T: Send + Sync,

Source§

fn from( value: ReadSignal<Option<T>, LocalStorage>, ) -> MaybeProp<T, LocalStorage>

Converts to this type from the input type.
Source§

impl<T> From<ReadSignal<Option<T>>> for MaybeProp<T>
where T: Send + Sync,

Source§

fn from(value: ReadSignal<Option<T>>) -> MaybeProp<T>

Converts to this type from the input type.
Source§

impl<T> From<ReadSignal<T, LocalStorage>> for MaybeProp<T, LocalStorage>
where T: Send + Sync + Clone,

Source§

fn from(value: ReadSignal<T, LocalStorage>) -> MaybeProp<T, LocalStorage>

Converts to this type from the input type.
Source§

impl<T> From<ReadSignal<T>> for MaybeProp<T>
where T: Send + Sync + Clone,

Source§

fn from(value: ReadSignal<T>) -> MaybeProp<T>

Converts to this type from the input type.
Source§

impl<T> From<RwSignal<Option<T>, LocalStorage>> for MaybeProp<T, LocalStorage>
where T: Send + Sync,

Source§

fn from(value: RwSignal<Option<T>, LocalStorage>) -> MaybeProp<T, LocalStorage>

Converts to this type from the input type.
Source§

impl<T> From<RwSignal<Option<T>>> for MaybeProp<T>
where T: Send + Sync,

Source§

fn from(value: RwSignal<Option<T>>) -> MaybeProp<T>

Converts to this type from the input type.
Source§

impl<T> From<RwSignal<T, LocalStorage>> for MaybeProp<T, LocalStorage>
where T: Send + Sync + Clone,

Source§

fn from(value: RwSignal<T, LocalStorage>) -> MaybeProp<T, LocalStorage>

Converts to this type from the input type.
Source§

impl<T> From<RwSignal<T>> for MaybeProp<T>
where T: Send + Sync + Clone,

Source§

fn from(value: RwSignal<T>) -> MaybeProp<T>

Converts to this type from the input type.
Source§

impl<T> From<Signal<Option<T>, LocalStorage>> for MaybeProp<T, LocalStorage>

Source§

fn from(value: Signal<Option<T>, LocalStorage>) -> MaybeProp<T, LocalStorage>

Converts to this type from the input type.
Source§

impl<T> From<Signal<Option<T>>> for MaybeProp<T>
where T: Send + Sync, SyncStorage: Storage<Option<T>>,

Source§

fn from(value: Signal<Option<T>>) -> MaybeProp<T>

Converts to this type from the input type.
Source§

impl<T> From<Signal<T, LocalStorage>> for MaybeProp<T, LocalStorage>
where T: Send + Sync + Clone,

Source§

fn from(value: Signal<T, LocalStorage>) -> MaybeProp<T, LocalStorage>

Converts to this type from the input type.
Source§

impl<T> From<Signal<T>> for MaybeProp<T>
where T: Send + Sync + Clone,

Source§

fn from(value: Signal<T>) -> MaybeProp<T>

Converts to this type from the input type.
Source§

impl<T> From<T> for MaybeProp<T>
where T: Send + Sync, SyncStorage: Storage<Option<T>>,

Source§

fn from(value: T) -> MaybeProp<T>

Converts to this type from the input type.
Source§

impl<T> FromLocal<Option<T>> for MaybeProp<T, LocalStorage>

Source§

fn from_local(value: Option<T>) -> MaybeProp<T, LocalStorage>

Converts between the types.
Source§

impl<T> FromLocal<T> for MaybeProp<T, LocalStorage>

Source§

fn from_local(value: T) -> MaybeProp<T, LocalStorage>

Converts between the types.
Source§

impl<T, S> PartialEq for MaybeProp<T, S>
where T: PartialEq + 'static, S: PartialEq + Storage<Option<T>> + Storage<SignalTypes<Option<T>, S>>,

Source§

fn eq(&self, other: &MaybeProp<T, S>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T, S> ReadUntracked for MaybeProp<T, S>
where T: Clone, S: Storage<Option<T>> + Storage<SignalTypes<Option<T>, S>>,

Source§

type Value = ReadGuard<Option<T>, SignalReadGuard<Option<T>, S>>

The guard type that will be returned, which can be dereferenced to the value.
Source§

fn try_read_untracked( &self, ) -> Option<<MaybeProp<T, S> as ReadUntracked>::Value>

Returns the guard, or None if the signal has already been disposed.
Source§

fn custom_try_read( &self, ) -> Option<Option<<MaybeProp<T, S> as ReadUntracked>::Value>>

This is a backdoor to allow overriding the Read::try_read implementation despite it being auto implemented. Read more
Source§

fn read_untracked(&self) -> Self::Value

Returns the guard. Read more
Source§

impl<T, St> Serialize for MaybeProp<T, St>
where T: Send + Sync + Serialize, St: Storage<SignalTypes<Option<T>, St>> + Storage<Option<T>>,

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T, S> StructuralPartialEq for MaybeProp<T, S>
where T: PartialEq + 'static, S: PartialEq + Storage<Option<T>> + Storage<SignalTypes<Option<T>, S>>,

Source§

impl<T, S> Track for MaybeProp<T, S>
where S: Storage<Option<T>> + Storage<SignalTypes<Option<T>, S>>,

Source§

fn track(&self)

Subscribes to this signal in the current reactive scope without doing anything with its value.

Auto Trait Implementations§

§

impl<T, S> Freeze for MaybeProp<T, S>

§

impl<T, S> RefUnwindSafe for MaybeProp<T, S>

§

impl<T, S> Send for MaybeProp<T, S>

§

impl<T, S> Sync for MaybeProp<T, S>

§

impl<T, S> Unpin for MaybeProp<T, S>

§

impl<T, S> UnsafeUnpin for MaybeProp<T, S>

§

impl<T, S> UnwindSafe for MaybeProp<T, S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<S, T> FromStream<T> for S
where S: From<ArcReadSignal<Option<T>>> + Send + Sync, T: Send + Sync + 'static,

Source§

fn from_stream(stream: impl Stream<Item = T> + Send + 'static) -> S

Creates a signal that contains the latest value of the stream.
Source§

fn from_stream_unsync(stream: impl Stream<Item = T> + 'static) -> S

Creates a signal that contains the latest value of the stream.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<CustErr, T, Request> IntoReq<GetUrl, Request, CustErr> for T
where Request: ClientReq<CustErr>, T: Serialize + Send,

Source§

fn into_req( self, path: &str, accepts: &str, ) -> Result<Request, ServerFnError<CustErr>>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<CustErr, T, Request> IntoReq<Json, Request, CustErr> for T
where Request: ClientReq<CustErr>, T: Serialize + Send,

Source§

fn into_req( self, path: &str, accepts: &str, ) -> Result<Request, ServerFnError<CustErr>>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<CustErr, T, Request> IntoReq<PostUrl, Request, CustErr> for T
where Request: ClientReq<CustErr>, T: Serialize + Send,

Source§

fn into_req( self, path: &str, accepts: &str, ) -> Result<Request, ServerFnError<CustErr>>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<CustErr, T, Response> IntoRes<Json, Response, CustErr> for T
where Response: Res<CustErr>, T: Serialize + Send,

Source§

async fn into_res(self) -> Result<Response, ServerFnError<CustErr>>

Attempts to serialize the output into an HTTP response.
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read for T
where T: Track + ReadUntracked,

Source§

type Value = <T as ReadUntracked>::Value

The guard type that will be returned, which can be dereferenced to the value.
Source§

fn try_read(&self) -> Option<<T as Read>::Value>

Subscribes to the signal, and returns the guard, or None if the signal has already been disposed.
Source§

fn read(&self) -> Self::Value

Subscribes to the signal, and returns the guard. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> With for T
where T: Read,

Source§

type Value = <<T as Read>::Value as Deref>::Target

The type of the value contained in the signal.
Source§

fn try_with<U>(&self, fun: impl FnOnce(&<T as With>::Value) -> U) -> Option<U>

Subscribes to the signal, applies the closure to the value, and returns the result, or None if the signal has already been disposed.
Source§

fn with<U>(&self, fun: impl FnOnce(&Self::Value) -> U) -> U

Subscribes to the signal, applies the closure to the value, and returns the result. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithUntracked for T

Source§

type Value = <<T as ReadUntracked>::Value as Deref>::Target

The type of the value contained in the signal.
Source§

fn try_with_untracked<U>( &self, fun: impl FnOnce(&<T as WithUntracked>::Value) -> U, ) -> Option<U>

Applies the closure to the value, and returns the result, or None if the signal has already been disposed.
Source§

fn with_untracked<U>(&self, fun: impl FnOnce(&Self::Value) -> U) -> U

Applies the closure to the value, and returns the result. Read more