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>

Source

pub fn new<S: Into<String>>( id: IdType, name: S, mutability: Mutability, value: Value, ) -> ReactiveProperty<IdType>

Source

pub fn get(&self) -> Value

Source

pub fn set_checked(&self, value: Value)

Source

pub fn set(&self, value: Value)

Source

pub fn set_no_propagate_checked(&self, value: Value)

Source

pub fn set_no_propagate(&self, value: Value)

Source

pub fn send(&self, signal: &Value)

Send a value down the stream, but does not change the current value

Source

pub fn tick_checked(&self)

Resend the current value manually if mutable

Source

pub fn tick(&self)

Resend the current value manually

Source

pub fn set_mutability(&mut self, mutability: Mutability)

Source

pub fn as_bool(&self) -> Option<bool>

Source

pub fn as_u64(&self) -> Option<u64>

Source

pub fn as_i64(&self) -> Option<i64>

Source

pub fn as_f64(&self) -> Option<f64>

Source

pub fn as_string(&self) -> Option<String>

Source

pub fn as_array(&self) -> Option<Vec<Value>>

Source

pub fn as_object(&self) -> Option<Map<String, Value>>

Trait Implementations§

Source§

impl<IdType: Clone> From<&ReactiveProperty<IdType>> for ContainerPropertyInstance<IdType>

Source§

fn from(property: &ReactiveProperty<IdType>) -> Self

Converts to this type from the input type.
Source§

impl<IdType: Clone> From<ReactiveProperty<IdType>> for ContainerPropertyInstance<IdType>

Source§

fn from(property: ReactiveProperty<IdType>) -> Self

Converts to this type from the input type.
Source§

impl<IdType: Clone> FromIterator<ReactiveProperty<IdType>> for ReactiveProperties<IdType>

Source§

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>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.