-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add trait impls for refs #94
Conversation
@aborgna-q What do you think of this solution? Do you see a less verbose way? We'd have to do the same for The better solution would probably to fix |
delegate! {
to (*self) {
fn port_direction(&self, port: impl Into<PortIndex>) -> Option<Direction>;
fn port_node(&self, port: impl Into<PortIndex>) -> Option<NodeIndex>;
...
}
} (see |
I have a matcher trait with the following method trait Matcher<G: GraphBase> {
fn find_rooted_matches(&self, G, root: <G as GraphBase>::NodeId);
fn find_matches(&self, G) where G: petgraph::visit::IntoNodeIndices {
// some code that requires petgraph::visit::IntoNodeIndices
}
} For the implemenation, it's nicer to write impl<G> Matcher<G> for SinglePatternMatcher<U, (), UnweightedEdge>
where
G: LinkView + GraphBase<NodeId = NodeIndex> + IntoNodeIndices
{ ... } rather than impl<'g, G> Matcher<&'g G> for SinglePatternMatcher<U, (), UnweightedEdge>
where
G: LinkView
&G: GraphBase<NodeId = NodeIndex> + IntoNodeIndices
{ ... } (if that syntax is even valid?) Does that make sense? |
s/IntoNodeIndices/IntoNodeIdentifiers/. It may be annoying to write if you ever have a generic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes #93