use super::edges::EdgeKey;
use crate::{Edge, Vertex};
use serde_json::Value as JsonValue;
use uuid::Uuid;
#[derive(Clone, Debug, PartialEq)]
pub struct VertexProperty {
pub id: Uuid,
pub value: JsonValue,
}
impl VertexProperty {
pub fn new(id: Uuid, value: JsonValue) -> Self {
Self { id, value }
}
}
#[derive(Clone, Debug, PartialEq)]
pub struct NamedProperty {
pub name: String,
pub value: JsonValue,
}
impl NamedProperty {
pub fn new(name: String, value: JsonValue) -> Self {
Self { name, value }
}
}
#[derive(Clone, Debug)]
pub struct VertexProperties {
pub vertex: Vertex,
pub props: Vec<NamedProperty>,
}
impl VertexProperties {
pub fn new(vertex: Vertex, props: Vec<NamedProperty>) -> Self {
VertexProperties { vertex, props }
}
}
#[derive(Clone, Debug)]
pub struct EdgeProperties {
pub edge: Edge,
pub props: Vec<NamedProperty>,
}
impl EdgeProperties {
pub fn new(edge: Edge, props: Vec<NamedProperty>) -> Self {
EdgeProperties { edge, props }
}
}
#[derive(Clone, Debug, PartialEq)]
pub struct EdgeProperty {
pub key: EdgeKey,
pub value: JsonValue,
}
impl EdgeProperty {
pub fn new(key: EdgeKey, value: JsonValue) -> Self {
Self { key, value }
}
}