Struct ReactiveRelationInstance

Source
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

Source

pub fn new_from_properties<T: Into<RelationInstanceTypeId>, P: Into<PropertyInstances>>( outbound: ReactiveEntity, ty: T, inbound: ReactiveEntity, properties: P, ) -> ReactiveRelationInstance

Source

pub fn new_from_instance( outbound: ReactiveEntity, inbound: ReactiveEntity, instance: RelationInstance, ) -> ReactiveRelationInstance

Source

pub fn relation_type_id(&self) -> RelationTypeId

Returns the inner relation type id.

Source

pub fn instance_id(&self) -> String

Returns the relation instance type id.

Trait Implementations§

Source§

impl From<ReactiveRelationInstance> for ReactiveRelation

Source§

fn from(relation_instance: ReactiveRelationInstance) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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.