pub struct RwSignal<T, S = UnsyncStorage> { /* private fields */ }Expand description
A read write Signal which can act as both a Getter and a Setter
Implementations§
Source§impl<T, S> RwSignal<T, S>
impl<T, S> RwSignal<T, S>
Sourcepub fn read_only(&self) -> ReadSignal<T, S>
pub fn read_only(&self) -> ReadSignal<T, S>
Create a Getter of this Signal
Sourcepub fn write_only(&self) -> WriteSignal<T, S>
pub fn write_only(&self) -> WriteSignal<T, S>
Create a Setter of this Signal
Source§impl<T> RwSignal<T, SyncStorage>
impl<T> RwSignal<T, SyncStorage>
Sourcepub fn new_sync(value: T) -> RwSignal<T, SyncStorage>
pub fn new_sync(value: T) -> RwSignal<T, SyncStorage>
Creates a sync signal. When called off the UI thread, the signal is left unscoped, so callers must ensure it is disposed manually.
Sourcepub fn new_sync_split(
value: T,
) -> (ReadSignal<T, SyncStorage>, WriteSignal<T, SyncStorage>)
pub fn new_sync_split( value: T, ) -> (ReadSignal<T, SyncStorage>, WriteSignal<T, SyncStorage>)
Creates a sync signal with separate read/write handles. Off-UI calls leave the signal unscoped; the caller is responsible for disposal.
Source§impl<T> RwSignal<T>where
T: 'static,
impl<T> RwSignal<T>where
T: 'static,
pub fn new(value: T) -> RwSignal<T>
pub fn new_split(value: T) -> (ReadSignal<T>, WriteSignal<T>)
Trait Implementations§
Source§impl<T> AddAssign<T> for RwSignal<T>where
T: AddAssign + 'static,
impl<T> AddAssign<T> for RwSignal<T>where
T: AddAssign + 'static,
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
Performs the
+= operation. Read moreSource§impl<T> BitAndAssign<T> for RwSignal<T>where
T: BitAndAssign + 'static,
impl<T> BitAndAssign<T> for RwSignal<T>where
T: BitAndAssign + 'static,
Source§fn bitand_assign(&mut self, rhs: T)
fn bitand_assign(&mut self, rhs: T)
Performs the
&= operation. Read moreSource§impl<T> BitOrAssign<T> for RwSignal<T>where
T: BitOrAssign + 'static,
impl<T> BitOrAssign<T> for RwSignal<T>where
T: BitOrAssign + 'static,
Source§fn bitor_assign(&mut self, rhs: T)
fn bitor_assign(&mut self, rhs: T)
Performs the
|= operation. Read moreSource§impl<T> BitXorAssign<T> for RwSignal<T>where
T: BitXorAssign + 'static,
impl<T> BitXorAssign<T> for RwSignal<T>where
T: BitXorAssign + 'static,
Source§fn bitxor_assign(&mut self, rhs: T)
fn bitxor_assign(&mut self, rhs: T)
Performs the
^= operation. Read moreSource§impl<T> DivAssign<T> for RwSignal<T>where
T: DivAssign + 'static,
impl<T> DivAssign<T> for RwSignal<T>where
T: DivAssign + 'static,
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/= operation. Read moreSource§impl<T: IntoView + Clone + 'static> IntoView for RwSignal<T>
impl<T: IntoView + Clone + 'static> IntoView for RwSignal<T>
Source§type V = DynamicView
type V = DynamicView
The final View type this converts to.
Source§type Intermediate = DynamicView
type Intermediate = DynamicView
Source§fn into_intermediate(self) -> Self::Intermediate
fn into_intermediate(self) -> Self::Intermediate
Source§impl<T> MulAssign<T> for RwSignal<T>where
T: MulAssign + 'static,
impl<T> MulAssign<T> for RwSignal<T>where
T: MulAssign + 'static,
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*= operation. Read moreSource§impl<T> RemAssign<T> for RwSignal<T>where
T: RemAssign + 'static,
impl<T> RemAssign<T> for RwSignal<T>where
T: RemAssign + 'static,
Source§fn rem_assign(&mut self, rhs: T)
fn rem_assign(&mut self, rhs: T)
Performs the
%= operation. Read moreSource§impl<T> ShlAssign<T> for RwSignal<T>where
T: ShlAssign + 'static,
impl<T> ShlAssign<T> for RwSignal<T>where
T: ShlAssign + 'static,
Source§fn shl_assign(&mut self, rhs: T)
fn shl_assign(&mut self, rhs: T)
Performs the
<<= operation. Read moreSource§impl<T> ShrAssign<T> for RwSignal<T>where
T: ShrAssign + 'static,
impl<T> ShrAssign<T> for RwSignal<T>where
T: ShrAssign + 'static,
Source§fn shr_assign(&mut self, rhs: T)
fn shr_assign(&mut self, rhs: T)
Performs the
>>= operation. Read moreSource§impl<T> SignalRead<T> for RwSignal<T>
impl<T> SignalRead<T> for RwSignal<T>
Source§fn try_read(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
fn try_read(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
If the signal isn’t disposed,
reads the data stored in the Signal and subscribes to the current running effect.
Source§fn try_read_untracked(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
fn try_read_untracked(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
If the signal isn’t disposed,
reads the data stored in the Signal without subscribing.
Source§fn read(&self) -> ReadRef<'_, T>where
T: 'static,
fn read(&self) -> ReadRef<'_, T>where
T: 'static,
Reads the data stored in the Signal, subscribing the current running effect.
Source§fn read_untracked(&self) -> ReadRef<'_, T>where
T: 'static,
fn read_untracked(&self) -> ReadRef<'_, T>where
T: 'static,
Reads the data stored in the Signal without subscribing.
Source§impl<T> SignalRead<T> for RwSignal<T, SyncStorage>
impl<T> SignalRead<T> for RwSignal<T, SyncStorage>
Source§fn try_read(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
fn try_read(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
If the signal isn’t disposed,
reads the data stored in the Signal and subscribes to the current running effect.
Source§fn try_read_untracked(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
fn try_read_untracked(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
If the signal isn’t disposed,
reads the data stored in the Signal without subscribing.
Source§fn read(&self) -> ReadRef<'_, T>where
T: 'static,
fn read(&self) -> ReadRef<'_, T>where
T: 'static,
Reads the data stored in the Signal, subscribing the current running effect.
Source§fn read_untracked(&self) -> ReadRef<'_, T>where
T: 'static,
fn read_untracked(&self) -> ReadRef<'_, T>where
T: 'static,
Reads the data stored in the Signal without subscribing.
Source§impl<T, S> SignalTrack<T> for RwSignal<T, S>
impl<T, S> SignalTrack<T> for RwSignal<T, S>
Source§impl<T> SignalUpdate<T> for RwSignal<T>
impl<T> SignalUpdate<T> for RwSignal<T>
Source§impl<T> SignalUpdate<T> for RwSignal<T, SyncStorage>
impl<T> SignalUpdate<T> for RwSignal<T, SyncStorage>
Source§impl<T> SignalWith<T> for RwSignal<T>
impl<T> SignalWith<T> for RwSignal<T>
fn with<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
fn with_untracked<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
fn try_with<O>(&self, f: impl FnOnce(Option<&T>) -> O) -> Owhere
T: 'static,
fn try_with_untracked<O>(&self, f: impl FnOnce(Option<&T>) -> O) -> Owhere
T: 'static,
Source§impl<T> SignalWith<T> for RwSignal<T, SyncStorage>
impl<T> SignalWith<T> for RwSignal<T, SyncStorage>
fn with<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
fn with_untracked<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
fn try_with<O>(&self, f: impl FnOnce(Option<&T>) -> O) -> Owhere
T: 'static,
fn try_with_untracked<O>(&self, f: impl FnOnce(Option<&T>) -> O) -> Owhere
T: 'static,
Source§impl<T> SignalWrite<T> for RwSignal<T>
impl<T> SignalWrite<T> for RwSignal<T>
Source§impl<T> SignalWrite<T> for RwSignal<T, SyncStorage>
impl<T> SignalWrite<T> for RwSignal<T, SyncStorage>
Source§impl<T> SubAssign<T> for RwSignal<T>where
T: SubAssign + 'static,
impl<T> SubAssign<T> for RwSignal<T>where
T: SubAssign + 'static,
Source§fn sub_assign(&mut self, rhs: T)
fn sub_assign(&mut self, rhs: T)
Performs the
-= operation. Read moreimpl<T, S> Copy for RwSignal<T, S>
impl<T, S> Eq for RwSignal<T, S>
Auto Trait Implementations§
impl<T, S> Freeze for RwSignal<T, S>
impl<T, S> RefUnwindSafe for RwSignal<T, S>where
T: RefUnwindSafe,
S: RefUnwindSafe,
impl<T, S> Send for RwSignal<T, S>
impl<T, S> Sync for RwSignal<T, S>
impl<T, S> Unpin for RwSignal<T, S>
impl<T, S> UnwindSafe for RwSignal<T, S>where
T: UnwindSafe,
S: UnwindSafe,
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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> ContainerExt for Twhere
T: IntoView + 'static,
impl<T> ContainerExt for Twhere
T: IntoView + 'static,
Source§impl<T> Decorators for Twhere
T: IntoView,
impl<T> Decorators for Twhere
T: IntoView,
Source§fn style(self, style: impl Fn(Style) -> Style + 'static) -> Self::Intermediate
fn style(self, style: impl Fn(Style) -> Style + 'static) -> Self::Intermediate
Alter the style of the view. Read more
Source§fn debug_name(self, name: impl Into<String>) -> Self::Intermediate
fn debug_name(self, name: impl Into<String>) -> Self::Intermediate
Add a debug name to the view that will be shown in the inspector. Read more
Source§fn debug_name_if<S: Into<String>>(
self,
apply: impl Fn() -> bool + 'static,
name: impl Fn() -> S + 'static,
) -> Self::Intermediate
fn debug_name_if<S: Into<String>>( self, apply: impl Fn() -> bool + 'static, name: impl Fn() -> S + 'static, ) -> Self::Intermediate
Conditionally add a debug name to the view that will be shown in the inspector. Read more
Source§fn dragging_style(
self,
style: impl Fn(Style) -> Style + 'static,
) -> Self::Intermediate
fn dragging_style( self, style: impl Fn(Style) -> Style + 'static, ) -> Self::Intermediate
The visual style to apply when the view is being dragged
Source§fn class<C: StyleClass>(self, _class: C) -> Self::Intermediate
fn class<C: StyleClass>(self, _class: C) -> Self::Intermediate
Add a style class to the view
Source§fn class_if<C: StyleClass>(
self,
apply: impl Fn() -> bool + 'static,
_class: C,
) -> Self::Intermediate
fn class_if<C: StyleClass>( self, apply: impl Fn() -> bool + 'static, _class: C, ) -> Self::Intermediate
Conditionally add a style class to the view
Source§fn remove_class<C: StyleClass>(self, _class: C) -> Self::Intermediate
fn remove_class<C: StyleClass>(self, _class: C) -> Self::Intermediate
Remove a style class from the view
👎Deprecated: Set this property using
Style::focusable insteadAllows the element to be navigated to with the keyboard. Similar to setting tabindex=“0” in html.
Source§fn disable_default_event(
self,
disable: impl Fn() -> (EventListener, bool) + 'static,
) -> Self::Intermediate
fn disable_default_event( self, disable: impl Fn() -> (EventListener, bool) + 'static, ) -> Self::Intermediate
Dynamically controls whether the default view behavior for an event should be disabled.
When disable is true, children will still see the event, but the view event function will not be called nor
the event listeners on the view. Read more
Source§fn draggable(self) -> Self::Intermediate
fn draggable(self) -> Self::Intermediate
👎Deprecated: use
Style::draggable directly insteadMark the view as draggable
Source§fn disabled(
self,
disabled_fn: impl Fn() -> bool + 'static,
) -> Self::Intermediate
fn disabled( self, disabled_fn: impl Fn() -> bool + 'static, ) -> Self::Intermediate
👎Deprecated: use
Style::set_disabled directly insteadMark the view as disabled Read more
Source§fn on_event(
self,
listener: EventListener,
action: impl FnMut(&Event) -> EventPropagation + 'static,
) -> Self::Intermediate
fn on_event( self, listener: EventListener, action: impl FnMut(&Event) -> EventPropagation + 'static, ) -> Self::Intermediate
Add an event handler for the given
EventListener.Source§fn on_key_down(
self,
key: Key,
cmp: impl Fn(Modifiers) -> bool + 'static,
action: impl Fn(&Event) + 'static,
) -> Self::Intermediate
fn on_key_down( self, key: Key, cmp: impl Fn(Modifiers) -> bool + 'static, action: impl Fn(&Event) + 'static, ) -> Self::Intermediate
Add an handler for pressing down a specific key. Read more
Source§fn on_key_up(
self,
key: Key,
cmp: impl Fn(Modifiers) -> bool + 'static,
action: impl Fn(&Event) + 'static,
) -> Self::Intermediate
fn on_key_up( self, key: Key, cmp: impl Fn(Modifiers) -> bool + 'static, action: impl Fn(&Event) + 'static, ) -> Self::Intermediate
Add an handler for a specific key being released. Read more
Source§fn on_event_cont(
self,
listener: EventListener,
action: impl Fn(&Event) + 'static,
) -> Self::Intermediate
fn on_event_cont( self, listener: EventListener, action: impl Fn(&Event) + 'static, ) -> Self::Intermediate
Add an event handler for the given
EventListener. This event will be handled with
the given handler and the event will continue propagating.Source§fn on_event_stop(
self,
listener: EventListener,
action: impl Fn(&Event) + 'static,
) -> Self::Intermediate
fn on_event_stop( self, listener: EventListener, action: impl Fn(&Event) + 'static, ) -> Self::Intermediate
Add an event handler for the given
EventListener. This event will be handled with
the given handler and the event will stop propagating.Source§fn on_click(
self,
action: impl FnMut(&Event) -> EventPropagation + 'static,
) -> Self::Intermediate
fn on_click( self, action: impl FnMut(&Event) -> EventPropagation + 'static, ) -> Self::Intermediate
Add an event handler for
EventListener::Click.Source§fn on_click_cont(self, action: impl Fn(&Event) + 'static) -> Self::Intermediate
fn on_click_cont(self, action: impl Fn(&Event) + 'static) -> Self::Intermediate
Add an event handler for
EventListener::Click. This event will be handled with
the given handler and the event will continue propagating.Source§fn on_click_stop(
self,
action: impl FnMut(&Event) + 'static,
) -> Self::Intermediate
fn on_click_stop( self, action: impl FnMut(&Event) + 'static, ) -> Self::Intermediate
Add an event handler for
EventListener::Click. This event will be handled with
the given handler and the event will stop propagating.Source§fn action(self, action: impl FnMut() + 'static) -> Self::Intermediate
fn action(self, action: impl FnMut() + 'static) -> Self::Intermediate
Attach action executed on button click or Enter or Space Key.
Source§fn on_double_click(
self,
action: impl Fn(&Event) -> EventPropagation + 'static,
) -> Self::Intermediate
fn on_double_click( self, action: impl Fn(&Event) -> EventPropagation + 'static, ) -> Self::Intermediate
Add an event handler for
EventListener::DoubleClickSource§fn on_double_click_cont(
self,
action: impl Fn(&Event) + 'static,
) -> Self::Intermediate
fn on_double_click_cont( self, action: impl Fn(&Event) + 'static, ) -> Self::Intermediate
Add an event handler for
EventListener::DoubleClick. This event will be handled with
the given handler and the event will continue propagating.Source§fn on_double_click_stop(
self,
action: impl Fn(&Event) + 'static,
) -> Self::Intermediate
fn on_double_click_stop( self, action: impl Fn(&Event) + 'static, ) -> Self::Intermediate
Add an event handler for
EventListener::DoubleClick. This event will be handled with
the given handler and the event will stop propagating.Source§fn on_secondary_click(
self,
action: impl Fn(&Event) -> EventPropagation + 'static,
) -> Self::Intermediate
fn on_secondary_click( self, action: impl Fn(&Event) -> EventPropagation + 'static, ) -> Self::Intermediate
Add an event handler for
EventListener::SecondaryClick. This is most often the “Right” click.Source§fn on_secondary_click_cont(
self,
action: impl Fn(&Event) + 'static,
) -> Self::Intermediate
fn on_secondary_click_cont( self, action: impl Fn(&Event) + 'static, ) -> Self::Intermediate
Add an event handler for
EventListener::SecondaryClick. This is most often the “Right” click.
This event will be handled with the given handler and the event will continue propagating.Source§fn on_secondary_click_stop(
self,
action: impl Fn(&Event) + 'static,
) -> Self::Intermediate
fn on_secondary_click_stop( self, action: impl Fn(&Event) + 'static, ) -> Self::Intermediate
Add an event handler for
EventListener::SecondaryClick. This is most often the “Right” click.
This event will be handled with the given handler and the event will stop propagating.Source§fn on_resize(self, action: impl Fn(Rect) + 'static) -> Self::Intermediate
fn on_resize(self, action: impl Fn(Rect) + 'static) -> Self::Intermediate
Adds an event handler for resize events for this view. Read more
Source§fn on_move(self, action: impl Fn(Point) + 'static) -> Self::Intermediate
fn on_move(self, action: impl Fn(Point) + 'static) -> Self::Intermediate
Adds an event handler for move events for this view. Read more
Source§fn on_cleanup(self, action: impl Fn() + 'static) -> Self::Intermediate
fn on_cleanup(self, action: impl Fn() + 'static) -> Self::Intermediate
Adds an event handler for cleanup events for this view. Read more
Source§fn animation(
self,
animation: impl Fn(Animation) -> Animation + 'static,
) -> Self::Intermediate
fn animation( self, animation: impl Fn(Animation) -> Animation + 'static, ) -> Self::Intermediate
Add an animation to the view. Read more
Source§fn clear_focus(self, when: impl Fn() + 'static) -> Self::Intermediate
fn clear_focus(self, when: impl Fn() + 'static) -> Self::Intermediate
Clear the focus from the window. Read more
Source§fn request_focus(self, when: impl Fn() + 'static) -> Self::Intermediate
fn request_focus(self, when: impl Fn() + 'static) -> Self::Intermediate
Request that this view gets the focus for the window. Read more
Source§fn window_scale(
self,
scale_fn: impl Fn() -> f64 + 'static,
) -> Self::Intermediate
fn window_scale( self, scale_fn: impl Fn() -> f64 + 'static, ) -> Self::Intermediate
Set the window scale factor. Read more
Source§fn window_title(
self,
title_fn: impl Fn() -> String + 'static,
) -> Self::Intermediate
fn window_title( self, title_fn: impl Fn() -> String + 'static, ) -> Self::Intermediate
Set the window title. Read more
Set the system window menu Read more
Adds a secondary-click context menu to the view, which opens at the mouse position. Read more
Adds a primary-click context menu, which opens below the view. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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.§fn as_any(&self) -> &(dyn Any + 'static)
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.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().