pub trait SchemaExt<NK, EK>: Sized
where NK: Key, EK: Key,
{ type N: NodeExt<NK>; type E: EdgeExt<EK>; // Required methods fn name(&self) -> String; fn allow_node( &self, node_ty: <Self::N as Typed>::Type ) -> Result<(), DisAllowedNode>; fn allow_edge( &self, outgoing_edge_count: usize, incoming_edge_count: usize, edge_ty: <Self::E as Typed>::Type, source: <Self::N as Typed>::Type, target: <Self::N as Typed>::Type ) -> Result<(), DisAllowedEdge>; }

Required Associated Types§

source

type N: NodeExt<NK>

Type of node weights used by the schema

source

type E: EdgeExt<EK>

Type of edge weights used by the schema

Required Methods§

source

fn name(&self) -> String

Get the name of the schema in order to provide better error messages

source

fn allow_node( &self, node_ty: <Self::N as Typed>::Type ) -> Result<(), DisAllowedNode>

Before adding a new node, check if the new node is allowed

Upon encountering an invalid edge return Err(InvalidType)

source

fn allow_edge( &self, outgoing_edge_count: usize, incoming_edge_count: usize, edge_ty: <Self::E as Typed>::Type, source: <Self::N as Typed>::Type, target: <Self::N as Typed>::Type ) -> Result<(), DisAllowedEdge>

Before adding a new edge check if the new edge is allowed

Upon encountering an invalid edge return Err(InvalidType) If the quantity limit is reached return Err(TomMny)

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<NK, EK, NT, ET> SchemaExt<NK, EK> for GenericSchema<NT, ET>

§

type N = GenericWeight<NK, NT>

§

type E = GenericWeight<EK, ET>

source§

impl<NK, EK, OldVersion, NewVersion> SchemaExt<NK, EK> for InBetween<NK, EK, OldVersion, NewVersion>
where NK: Key, EK: Key, OldVersion: SchemaExt<NK, EK> + MigrateSchema<NK, EK, NewVersion>, NewVersion: SchemaExt<NK, EK>,

§

type N = EitherVersion<<OldVersion as SchemaExt<NK, EK>>::N, <NewVersion as SchemaExt<NK, EK>>::N>

§

type E = EitherVersion<<OldVersion as SchemaExt<NK, EK>>::E, <NewVersion as SchemaExt<NK, EK>>::E>