Struct ori_core::ReadSignal
source · pub struct ReadSignal<T: ?Sized> { /* private fields */ }
Expand description
A read-only Signal
.
Implementations§
source§impl<T> ReadSignal<T>
impl<T> ReadSignal<T>
sourcepub fn new(value: T) -> Self
pub fn new(value: T) -> Self
Creates a new ReadSignal
from a value.
source§impl<T: ?Sized> ReadSignal<T>
impl<T: ?Sized> ReadSignal<T>
sourcepub fn new_arc(value: Rc<T>) -> Self
pub fn new_arc(value: Rc<T>) -> Self
Creates a new ReadSignal
from an [Shared
].
sourcepub fn emitter(&self) -> &CallbackEmitter
pub fn emitter(&self) -> &CallbackEmitter
Gets the CallbackEmitter
for this ReadSignal
.
sourcepub fn get(&self) -> Rc<T>
pub fn get(&self) -> Rc<T>
Gets the current value of self
.
This will track self
in the currently running effect
.
sourcepub fn get_untracked(&self) -> Rc<T>
pub fn get_untracked(&self) -> Rc<T>
Gets the current value of self
without tracking it.
source§impl<T: Clone> ReadSignal<T>
impl<T: Clone> ReadSignal<T>
sourcepub fn cloned(&self) -> T
pub fn cloned(&self) -> T
Returns a clone of the current value of self
.
This will track self
in the currently running effect
.
sourcepub fn cloned_untracked(&self) -> T
pub fn cloned_untracked(&self) -> T
Returns a clone of the current value of self
without tracking it.
source§impl<T: Copy> ReadSignal<T>
impl<T: Copy> ReadSignal<T>
sourcepub fn copied_untracked(&self) -> T
pub fn copied_untracked(&self) -> T
Returns a copy to the current value of self
.
Trait Implementations§
source§impl<T: Default> Default for ReadSignal<T>
impl<T: Default> Default for ReadSignal<T>
source§impl<T> From<&ReadSignal<T>> for StyleAttributeValuewhere
T: Into<StyleAttributeValue> + Clone,
impl<T> From<&ReadSignal<T>> for StyleAttributeValuewhere T: Into<StyleAttributeValue> + Clone,
source§fn from(value: &ReadSignal<T>) -> Self
fn from(value: &ReadSignal<T>) -> Self
Converts to this type from the input type.
source§impl<T: Ord + ?Sized> Ord for ReadSignal<T>
impl<T: Ord + ?Sized> Ord for ReadSignal<T>
source§impl<T: PartialEq + ?Sized> PartialEq<ReadSignal<T>> for ReadSignal<T>
impl<T: PartialEq + ?Sized> PartialEq<ReadSignal<T>> for ReadSignal<T>
source§impl<T: PartialOrd + ?Sized> PartialOrd<ReadSignal<T>> for ReadSignal<T>
impl<T: PartialOrd + ?Sized> PartialOrd<ReadSignal<T>> for ReadSignal<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<T: PartialOrd + ?Sized> PartialOrd<T> for ReadSignal<T>
impl<T: PartialOrd + ?Sized> PartialOrd<T> for ReadSignal<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: Eq + ?Sized> Eq for ReadSignal<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for ReadSignal<T>
impl<T> !Send for ReadSignal<T>
impl<T> !Sync for ReadSignal<T>
impl<T: ?Sized> Unpin for ReadSignal<T>
impl<T> !UnwindSafe for ReadSignal<T>
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> 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>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere R: Read + ReadEndian<P>, P: Default,
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()
.source§impl<T> Styleable<T> for T
impl<T> Styleable<T> for T
source§fn styled(self) -> Styled<T>
fn styled(self) -> Styled<T>
Converts the
self
into a Styled<Self>
value.source§fn attr_trans(
self,
key: &str,
value: impl Into<StyleAttributeValue>,
transition: impl Into<StyleTransition>
) -> Styled<T>
fn attr_trans( self, key: &str, value: impl Into<StyleAttributeValue>, transition: impl Into<StyleTransition> ) -> Styled<T>
Adds an attribute with a transition.