pub struct ReactiveProperty<IdType: Clone> {
pub id: IdType,
pub name: String,
pub mutability: Mutability,
pub stream: Arc<RwLock<Stream<'static, Value>>>,
pub value: RwLock<Value>,
}
Fields§
§id: IdType
The parent identifier (entity: uuid, relation: RelationInstanceId)
name: String
Property name
mutability: Mutability
The property instance is mutable or immutable.
stream: Arc<RwLock<Stream<'static, Value>>>
The reactive stream
value: RwLock<Value>
Store the current value
Implementations§
Source§impl<IdType: Clone> ReactiveProperty<IdType>
impl<IdType: Clone> ReactiveProperty<IdType>
pub fn new<S: Into<String>>( id: IdType, name: S, mutability: Mutability, value: Value, ) -> ReactiveProperty<IdType>
pub fn get(&self) -> Value
pub fn set_checked(&self, value: Value)
pub fn set(&self, value: Value)
pub fn set_no_propagate_checked(&self, value: Value)
pub fn set_no_propagate(&self, value: Value)
Sourcepub fn send(&self, signal: &Value)
pub fn send(&self, signal: &Value)
Send a value down the stream, but does not change the current value
Sourcepub fn tick_checked(&self)
pub fn tick_checked(&self)
Resend the current value manually if mutable
pub fn set_mutability(&mut self, mutability: Mutability)
pub fn as_bool(&self) -> Option<bool>
pub fn as_u64(&self) -> Option<u64>
pub fn as_i64(&self) -> Option<i64>
pub fn as_f64(&self) -> Option<f64>
pub fn as_string(&self) -> Option<String>
pub fn as_array(&self) -> Option<Vec<Value>>
pub fn as_object(&self) -> Option<Map<String, Value>>
Trait Implementations§
Source§impl<IdType: Clone> From<&ReactiveProperty<IdType>> for ContainerPropertyInstance<IdType>
impl<IdType: Clone> From<&ReactiveProperty<IdType>> for ContainerPropertyInstance<IdType>
Source§fn from(property: &ReactiveProperty<IdType>) -> Self
fn from(property: &ReactiveProperty<IdType>) -> Self
Converts to this type from the input type.
Source§impl<IdType: Clone> From<ReactiveProperty<IdType>> for ContainerPropertyInstance<IdType>
impl<IdType: Clone> From<ReactiveProperty<IdType>> for ContainerPropertyInstance<IdType>
Source§fn from(property: ReactiveProperty<IdType>) -> Self
fn from(property: ReactiveProperty<IdType>) -> Self
Converts to this type from the input type.
Source§impl<IdType: Clone> FromIterator<ReactiveProperty<IdType>> for ReactiveProperties<IdType>
impl<IdType: Clone> FromIterator<ReactiveProperty<IdType>> for ReactiveProperties<IdType>
Source§fn from_iter<I: IntoIterator<Item = ReactiveProperty<IdType>>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = ReactiveProperty<IdType>>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<IdType: Clone> PartialEq for ReactiveProperty<IdType>
impl<IdType: Clone> PartialEq for ReactiveProperty<IdType>
Auto Trait Implementations§
impl<IdType> !Freeze for ReactiveProperty<IdType>
impl<IdType> RefUnwindSafe for ReactiveProperty<IdType>where
IdType: RefUnwindSafe,
impl<IdType> Send for ReactiveProperty<IdType>where
IdType: Send,
impl<IdType> Sync for ReactiveProperty<IdType>where
IdType: Sync,
impl<IdType> Unpin for ReactiveProperty<IdType>where
IdType: Unpin,
impl<IdType> UnwindSafe for ReactiveProperty<IdType>where
IdType: UnwindSafe,
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> 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