Struct dioxus::prelude::Write

source ·
pub struct Write<'a, T, S = UnsyncStorage>
where T: 'static + ?Sized, S: AnyStorage,
{ /* private fields */ }
Available on crate feature signals only.
Expand description

A mutable reference to a signal’s value.

T is the current type of the write S is the storage type of the signal

Implementations§

source§

impl<'a, T, S> Write<'a, T, S>
where T: 'static + ?Sized, S: AnyStorage,

source

pub fn map<O>( myself: Write<'a, T, S>, f: impl FnOnce(&mut T) -> &mut O ) -> Write<'a, O, S>
where O: ?Sized,

Map the mutable reference to the signal’s value to a new type.

source

pub fn filter_map<O>( myself: Write<'a, T, S>, f: impl FnOnce(&mut T) -> Option<&mut O> ) -> Option<Write<'a, O, S>>
where O: ?Sized,

Try to map the mutable reference to the signal’s value to a new type

source

pub fn downcast_lifetime<'b>(mut_: Write<'a, T, S>) -> Write<'b, T, S>
where 'a: 'b,

Downcast the lifetime of the mutable reference to the signal’s value.

This function enforces the variance of the lifetime parameter 'a in Mut. Rust will typically infer this cast with a concrete type, but it cannot with a generic type.

Trait Implementations§

source§

impl<T, S> Deref for Write<'_, T, S>
where T: 'static + ?Sized, S: AnyStorage,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Write<'_, T, S> as Deref>::Target

Dereferences the value.
source§

impl<T, S> DerefMut for Write<'_, T, S>
where S: AnyStorage, T: ?Sized,

source§

fn deref_mut(&mut self) -> &mut <Write<'_, T, S> as Deref>::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, T, S> Freeze for Write<'a, T, S>
where S: Default, <S as AnyStorage>::Mut<'a, T>: Freeze, T: ?Sized,

§

impl<'a, T, S = UnsyncStorage> !RefUnwindSafe for Write<'a, T, S>

§

impl<'a, T, S = UnsyncStorage> !Send for Write<'a, T, S>

§

impl<'a, T, S = UnsyncStorage> !Sync for Write<'a, T, S>

§

impl<'a, T, S> Unpin for Write<'a, T, S>
where S: Default, <S as AnyStorage>::Mut<'a, T>: Unpin, T: ?Sized,

§

impl<'a, T, S = UnsyncStorage> !UnwindSafe for Write<'a, 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<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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, O> SuperFrom<T> for O
where O: From<T>,

source§

fn super_from(input: T) -> O

Convert from a type to another type.
source§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

source§

fn super_into(self) -> O

Convert from a type to another type.
source§

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

source§

fn to<T>(self) -> T
where Self: Into<T>,

Converts to T by calling Into<T>::into.
source§

fn try_to<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Tries to convert to T by calling TryInto<T>::try_into.
source§

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

§

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>,

§

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<Cfg> TryIntoConfig for Cfg

source§

fn into_config(self) -> Option<Cfg>

Available on crate feature launch only.
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