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)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.