Trait typed_graph::SchemaExt
source · pub trait SchemaExt<NK, EK>: Sized{
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§
Required Methods§
sourcefn allow_node(
&self,
node_ty: <Self::N as Typed>::Type
) -> Result<(), DisAllowedNode>
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)
sourcefn 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>
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.