Redesigned 'links types provider' to 'struct metadata'
This commit is contained in:
parent
a133d5e187
commit
b59b0f03dd
@ -1,5 +1,7 @@
|
||||
mod node_ref;
|
||||
mod links;
|
||||
mod metadata;
|
||||
|
||||
pub use node_ref::*;
|
||||
pub use links::*;
|
||||
pub use metadata::*;
|
||||
|
||||
@ -1,11 +1,7 @@
|
||||
pub trait LinkedStructLinksTypeProvider {
|
||||
type Links: Sized;
|
||||
}
|
||||
|
||||
pub trait LinkedStructLinksOffset: LinkedStructLinksTypeProvider {
|
||||
pub trait LinkedStructLinksOffset {
|
||||
type Node;
|
||||
type Links;
|
||||
|
||||
fn getLinks<R>(nodeRef: &Self::Node, consumer: impl FnOnce(&Self::Links) -> R) -> R;
|
||||
|
||||
fn getLinksMut<R>(nodeRef: &mut Self::Node, consumer: impl FnOnce(&mut Self::Links) -> R) -> R;
|
||||
}
|
||||
|
||||
7
src/metadata.rs
Normal file
7
src/metadata.rs
Normal file
@ -0,0 +1,7 @@
|
||||
use crate::LinkedStructNodeRef;
|
||||
|
||||
pub trait LinkedStructMetadata {
|
||||
type Links<Node>: Sized;
|
||||
|
||||
type NodeRef<Node>: LinkedStructNodeRef;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user