pub struct ReactiveRelationInstance {
pub outbound: ReactiveEntity,
pub ty: RelationInstanceTypeId,
pub inbound: ReactiveEntity,
pub name: String,
pub description: String,
pub properties: ReactiveProperties<RelationInstanceId>,
pub components: ComponentTypeIds,
pub behaviours: BehaviourTypeIds,
}
Expand description
Reactive instance of a relation in the directed property graph.
Property Graph: The relation instance can store properties.
Directed Graph: The direction of the relation point from the outbound entity instance to the inbound entity instance.
Reactive Instance: The properties are streams with a local copies of the last result. The streams can be connected, combined, folded or zipped.
One example for a directed reactive relation instance is a connector which propagates changes on a property of the outbound entity to a property of the inbound entity.
Another example would be the velocity transformation which are also using the streams of the properties of the outbound entity, the inbound entity and/or the relation itself.
Last but not least relation instances can be used for semantic representations like the current camera of a player: Player–(CurrentCamera)–>Camera
Fields§
§outbound: ReactiveEntity
The outbound entity instance.
ty: RelationInstanceTypeId
The type definition of the relation type.
inbound: ReactiveEntity
The outbound entity instance.
name: String
The name of the relation instance.
description: String
Textual description of the relation instance.
properties: ReactiveProperties<RelationInstanceId>
The reactive properties.
components: ComponentTypeIds
The names of the components which are applied on this relation instance.
behaviours: BehaviourTypeIds
The names of the behaviours which are applied on this relation instance.
Implementations§
Source§impl ReactiveRelationInstance
impl ReactiveRelationInstance
pub fn new_from_properties<T: Into<RelationInstanceTypeId>, P: Into<PropertyInstances>>( outbound: ReactiveEntity, ty: T, inbound: ReactiveEntity, properties: P, ) -> ReactiveRelationInstance
pub fn new_from_instance( outbound: ReactiveEntity, inbound: ReactiveEntity, instance: RelationInstance, ) -> ReactiveRelationInstance
Sourcepub fn relation_type_id(&self) -> RelationTypeId
pub fn relation_type_id(&self) -> RelationTypeId
Returns the inner relation type id.
Sourcepub fn instance_id(&self) -> String
pub fn instance_id(&self) -> String
Returns the relation instance type id.
Trait Implementations§
Source§impl From<ReactiveRelationInstance> for ReactiveRelation
impl From<ReactiveRelationInstance> for ReactiveRelation
Source§fn from(relation_instance: ReactiveRelationInstance) -> Self
fn from(relation_instance: ReactiveRelationInstance) -> Self
Auto Trait Implementations§
impl Freeze for ReactiveRelationInstance
impl !RefUnwindSafe for ReactiveRelationInstance
impl Send for ReactiveRelationInstance
impl Sync for ReactiveRelationInstance
impl Unpin for ReactiveRelationInstance
impl !UnwindSafe for ReactiveRelationInstance
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
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>
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>
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