EdgeCreator

Struct EdgeCreator 

Source
pub struct EdgeCreator { /* private fields */ }
Expand description

Interactive edge creator for handling edge creation workflow

Implementations§

Source§

impl EdgeCreator

Source

pub fn new() -> Self

Create a new edge creator

Source

pub fn is_creating_edge(&self) -> bool

Check if currently creating an edge

Source

pub fn get_preview_edge(&self) -> Option<&PreviewEdge>

Get the current preview edge

Source

pub fn start_edge_creation<N, E>( &mut self, graph: &Graph<N, E>, source_node: &str, source_handle: &str, start_position: Position, ) -> Result<()>

Start edge creation from a source handle

Source

pub fn update_edge_preview(&mut self, end_position: Position)

Update the preview edge end position

Source

pub fn complete_edge_creation<N, E>( &mut self, graph: &mut Graph<N, E>, target_node: &str, target_handle: Option<&str>, _end_position: Position, ) -> Result<()>
where N: Clone, E: Clone + Default,

Complete edge creation to a target node/handle

Source

pub fn cancel_edge_creation(&mut self)

Cancel edge creation

Source

pub fn get_drop_target<N, E>( &self, graph: &Graph<N, E>, position: Position, tolerance: f64, ) -> Option<(NodeId, Option<String>)>

Get potential drop target at given position

Source

pub fn get_connection_feedback<N, E>( &self, _graph: &Graph<N, E>, target_node: &str, _target_handle: Option<&str>, ) -> ConnectionFeedback

Get connection feedback for validation

Trait Implementations§

Source§

impl Debug for EdgeCreator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EdgeCreator

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.