pub trait GraphAdapter {
type NodeId: Id;
type SocketId: Id;
// Required methods
fn nodes(
&mut self,
) -> impl NodeIterator<NodeId = Self::NodeId, SocketId = Self::SocketId>;
fn connection_hint(
&self,
a: Self::SocketId,
b: Self::SocketId,
) -> ConnectionHint;
fn connect(&mut self, a: Self::SocketId, b: Self::SocketId);
fn connections(
&self,
) -> impl Iterator<Item = (Self::SocketId, Self::SocketId)>;
}
Expand description
An adapter for a graph to interact with a visual editor.
Required Associated Types§
Required Methods§
Sourcefn nodes(
&mut self,
) -> impl NodeIterator<NodeId = Self::NodeId, SocketId = Self::SocketId>
fn nodes( &mut self, ) -> impl NodeIterator<NodeId = Self::NodeId, SocketId = Self::SocketId>
An iterator over the node’s adapters of the graph.
Sourcefn connection_hint(
&self,
a: Self::SocketId,
b: Self::SocketId,
) -> ConnectionHint
fn connection_hint( &self, a: Self::SocketId, b: Self::SocketId, ) -> ConnectionHint
A hint about the connection between the sockets a
and b
.
This hint is used to provide a feedback to the user before they submit the connection.
Sourcefn connect(&mut self, a: Self::SocketId, b: Self::SocketId)
fn connect(&mut self, a: Self::SocketId, b: Self::SocketId)
The user submit a connection between the sockets a
and b
.
Sourcefn connections(&self) -> impl Iterator<Item = (Self::SocketId, Self::SocketId)>
fn connections(&self) -> impl Iterator<Item = (Self::SocketId, Self::SocketId)>
An iterator over the connections between sockets.
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.