#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum RelationshipDirection {
Outgoing,
Incoming,
Undirected,
}
crate::impl_retained_heap_for_copy!(RelationshipDirection);
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum RelationshipEndpoint {
Start,
End,
}
impl RelationshipEndpoint {
pub fn from_function_name(name: &str) -> Option<Self> {
[Self::Start, Self::End]
.into_iter()
.find(|endpoint| name.eq_ignore_ascii_case(endpoint.function_name()))
}
pub const fn function_name(self) -> &'static str {
match self {
Self::Start => "startNode",
Self::End => "endNode",
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum LabelFunction {
Label,
Labels,
}
impl LabelFunction {
pub fn from_function_name(name: &str) -> Option<Self> {
[Self::Label, Self::Labels]
.into_iter()
.find(|function| name.eq_ignore_ascii_case(function.function_name()))
}
pub const fn function_name(self) -> &'static str {
match self {
Self::Label => "label",
Self::Labels => "labels",
}
}
}