pub struct RelationInstance {
pub outbound_id: Uuid,
pub ty: RelationInstanceTypeId,
pub inbound_id: Uuid,
pub name: String,
pub description: String,
pub properties: PropertyInstances,
pub components: ComponentTypeIds,
pub extensions: Extensions,
}
Expand description
Relation instances are edges from an outbound entity instance to an inbound entity instance.
The relation instance is of a relation type. The relation type defines the entity types of the outbound entity instance and the inbound entity instance. Furthermore, the relation type defines which properties (name, data type, socket type) a relation instance have to have.
In contrast to the relation type, the relation instance stores values/ documents in its properties.
Fields§
§outbound_id: Uuid
The id of the outbound vertex.
ty: RelationInstanceTypeId
The relation instance id is unique and consists of the relation type and an instance_id.
inbound_id: Uuid
The id of the inbound vertex.
name: String
The name of the relation instance.
description: String
Textual description of the relation instance.
properties: PropertyInstances
The properties of then relation instance.
Each property is represented by its name (String) and it’s value. The value is a representation of a JSON. Therefore, the value can be boolean, number, string, array or an object. For more information about the data types please look at https://docs.serde.rs/serde_json/value/enum.Value.html
components: ComponentTypeIds
The components of the entity instance.
extensions: Extensions
Relation instance specific extensions.
Implementations§
Source§impl RelationInstance
impl RelationInstance
Sourcepub fn builder() -> RelationInstanceBuilder<((), (), (), (), (), (), (), ())>
pub fn builder() -> RelationInstanceBuilder<((), (), (), (), (), (), (), ())>
Create a builder for building RelationInstance
.
On the builder, call .outbound_id(...)
, .ty(...)
, .inbound_id(...)
, .name(...)
(optional), .description(...)
(optional), .properties(...)
(optional), .components(...)
(optional), .extensions(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of RelationInstance
.
Source§impl RelationInstance
impl RelationInstance
Sourcepub fn new<T: Into<RelationInstanceTypeId>, P: Into<PropertyInstances>>(
outbound_id: Uuid,
ty: T,
inbound_id: Uuid,
properties: P,
) -> RelationInstance
pub fn new<T: Into<RelationInstanceTypeId>, P: Into<PropertyInstances>>( outbound_id: Uuid, ty: T, inbound_id: Uuid, properties: P, ) -> RelationInstance
Constructs a new relation instance with the given outbound_id, type, inbound_id and properties
Sourcepub fn new_from_type_unique_id<S: Into<String>, P: Into<PropertyInstances>>(
namespace: S,
outbound_id: Uuid,
type_name: S,
inbound_id: Uuid,
properties: P,
) -> RelationInstance
pub fn new_from_type_unique_id<S: Into<String>, P: Into<PropertyInstances>>( namespace: S, outbound_id: Uuid, type_name: S, inbound_id: Uuid, properties: P, ) -> RelationInstance
Constructs a new relation instance with the given outbound_id, type, inbound_id and properties
Sourcepub fn new_from_type_unique_for_instance_id<S: Into<String>, P: Into<PropertyInstances>>(
namespace: S,
outbound_id: Uuid,
type_name: S,
instance_id: S,
inbound_id: Uuid,
properties: P,
) -> RelationInstance
pub fn new_from_type_unique_for_instance_id<S: Into<String>, P: Into<PropertyInstances>>( namespace: S, outbound_id: Uuid, type_name: S, instance_id: S, inbound_id: Uuid, properties: P, ) -> RelationInstance
Constructs a new relation instance with the given outbound_id, type, inbound_id and properties
Sourcepub fn new_from_type_with_random_instance_id<S: Into<String>, P: Into<PropertyInstances>>(
namespace: S,
outbound_id: Uuid,
type_name: S,
inbound_id: Uuid,
properties: P,
) -> RelationInstance
pub fn new_from_type_with_random_instance_id<S: Into<String>, P: Into<PropertyInstances>>( namespace: S, outbound_id: Uuid, type_name: S, inbound_id: Uuid, properties: P, ) -> RelationInstance
Constructs a new relation instance with the given outbound_id, type, inbound_id and properties
Sourcepub fn new_without_properties<T: Into<RelationInstanceTypeId>>(
outbound_id: Uuid,
ty: T,
inbound_id: Uuid,
) -> RelationInstance
pub fn new_without_properties<T: Into<RelationInstanceTypeId>>( outbound_id: Uuid, ty: T, inbound_id: Uuid, ) -> RelationInstance
Constructs a new relation instance with the given outbound_id, type, inbound_id but without properties
Sourcepub fn id(&self) -> RelationInstanceId
pub fn id(&self) -> RelationInstanceId
Returns the relation instance id.
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 Clone for RelationInstance
impl Clone for RelationInstance
Source§fn clone(&self) -> RelationInstance
fn clone(&self) -> RelationInstance
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl ComponentTypeIdContainer for RelationInstance
impl ComponentTypeIdContainer for RelationInstance
Source§fn is_a(&self, ty: &ComponentTypeId) -> bool
fn is_a(&self, ty: &ComponentTypeId) -> bool
Source§fn add_component<C: Into<ComponentTypeId>>(&self, ty: C) -> bool
fn add_component<C: Into<ComponentTypeId>>(&self, ty: C) -> bool
Source§fn add_components<C: Into<ComponentTypeIds>>(&mut self, components_to_add: C)
fn add_components<C: Into<ComponentTypeIds>>(&mut self, components_to_add: C)
Source§fn remove_component(&self, ty: &ComponentTypeId) -> Option<ComponentTypeId>
fn remove_component(&self, ty: &ComponentTypeId) -> Option<ComponentTypeId>
Source§fn remove_components<C: Into<ComponentTypeIds>>(
&mut self,
components_to_remove: C,
)
fn remove_components<C: Into<ComponentTypeIds>>( &mut self, components_to_remove: C, )
Source§fn is_any(&self, component_tys: &ComponentTypeIds) -> bool
fn is_any(&self, component_tys: &ComponentTypeIds) -> bool
Source§fn is_all(&self, component_tys: &ComponentTypeIds) -> bool
fn is_all(&self, component_tys: &ComponentTypeIds) -> bool
Source§impl Debug for RelationInstance
impl Debug for RelationInstance
Source§impl<'de> Deserialize<'de> for RelationInstance
impl<'de> Deserialize<'de> for RelationInstance
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for RelationInstance
impl Display for RelationInstance
Source§impl ExtensionContainer for RelationInstance
impl ExtensionContainer for RelationInstance
Source§fn has_own_extension(&self, ty: &ExtensionTypeId) -> bool
fn has_own_extension(&self, ty: &ExtensionTypeId) -> bool
Source§fn get_own_extension(&self, ty: &ExtensionTypeId) -> Option<Extension>
fn get_own_extension(&self, ty: &ExtensionTypeId) -> Option<Extension>
fn add_extension<E: Into<Extension>>( &self, extension: E, ) -> Result<ExtensionTypeId, AddExtensionError>
fn update_extension<T: Into<ExtensionTypeId>, E: Into<Extension>>( &self, ty: T, extension: E, ) -> Result<Extension, UpdateExtensionError>
fn remove_extension<T: Into<ExtensionTypeId>>( &self, ty: T, ) -> Result<Extension, RemoveExtensionError>
Source§fn merge_extensions<E: Into<Extensions>>(&mut self, extensions_to_merge: E)
fn merge_extensions<E: Into<Extensions>>(&mut self, extensions_to_merge: E)
Source§fn has_any_own_extensions(&self, tys: &ExtensionTypeIds) -> bool
fn has_any_own_extensions(&self, tys: &ExtensionTypeIds) -> bool
Source§fn has_all_own_extensions(&self, tys: &ExtensionTypeIds) -> bool
fn has_all_own_extensions(&self, tys: &ExtensionTypeIds) -> bool
Source§impl FromIterator<RelationInstance> for RelationInstances
impl FromIterator<RelationInstance> for RelationInstances
Source§fn from_iter<I: IntoIterator<Item = RelationInstance>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = RelationInstance>>(iter: I) -> Self
Source§impl Hash for RelationInstance
impl Hash for RelationInstance
Source§impl JsonSchema for RelationInstance
impl JsonSchema for RelationInstance
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref
keyword. Read more§fn always_inline_schema() -> bool
fn always_inline_schema() -> bool
inline_schema()
insteadinline_schema()
instead“. Read moreSource§impl Ord for RelationInstance
impl Ord for RelationInstance
Source§impl PartialEq for RelationInstance
impl PartialEq for RelationInstance
Source§impl PartialOrd for RelationInstance
impl PartialOrd for RelationInstance
Source§impl PropertyInstanceGetter for RelationInstance
impl PropertyInstanceGetter for RelationInstance
Source§fn get<S: Into<String>>(&self, property_name: S) -> Option<Value>
fn get<S: Into<String>>(&self, property_name: S) -> Option<Value>
Source§fn as_bool<S: Into<String>>(&self, property_name: S) -> Option<bool>
fn as_bool<S: Into<String>>(&self, property_name: S) -> Option<bool>
Source§fn as_u64<S: Into<String>>(&self, property_name: S) -> Option<u64>
fn as_u64<S: Into<String>>(&self, property_name: S) -> Option<u64>
Source§fn as_i64<S: Into<String>>(&self, property_name: S) -> Option<i64>
fn as_i64<S: Into<String>>(&self, property_name: S) -> Option<i64>
Source§fn as_f64<S: Into<String>>(&self, property_name: S) -> Option<f64>
fn as_f64<S: Into<String>>(&self, property_name: S) -> Option<f64>
Source§fn as_string<S: Into<String>>(&self, property_name: S) -> Option<String>
fn as_string<S: Into<String>>(&self, property_name: S) -> Option<String>
Source§impl Serialize for RelationInstance
impl Serialize for RelationInstance
Source§impl TypeDefinitionGetter for RelationInstance
impl TypeDefinitionGetter for RelationInstance
Source§fn type_definition(&self) -> TypeDefinition
fn type_definition(&self) -> TypeDefinition
impl Eq for RelationInstance
impl StructuralPartialEq for RelationInstance
Auto Trait Implementations§
impl Freeze for RelationInstance
impl !RefUnwindSafe for RelationInstance
impl Send for RelationInstance
impl Sync for RelationInstance
impl Unpin for RelationInstance
impl UnwindSafe for RelationInstance
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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