pub struct Node<N, E, Ty = Directed, Ix = DefaultIx, D = DefaultNodeShape>{ /* private fields */ }Implementations§
Source§impl<N, E, Ty, Ix, D> Node<N, E, Ty, Ix, D>
impl<N, E, Ty, Ix, D> Node<N, E, Ty, Ix, D>
Sourcepub fn new_with_props(props: NodeProps<N>) -> Self
pub fn new_with_props(props: NodeProps<N>) -> Self
Creates a new node with custom properties
pub fn props(&self) -> &NodeProps<N>
pub fn display(&self) -> &D
pub fn display_mut(&mut self) -> &mut D
pub fn id(&self) -> NodeIndex<Ix>
pub fn payload(&self) -> &N
pub fn payload_mut(&mut self) -> &mut N
pub fn color(&self) -> Option<Color32>
pub fn set_color(&mut self, color: Color32)
pub fn location(&self) -> Pos2
pub fn set_location(&mut self, loc: Pos2)
pub fn selected(&self) -> bool
pub fn set_selected(&mut self, selected: bool)
pub fn dragged(&self) -> bool
pub fn set_dragged(&mut self, dragged: bool)
pub fn hovered(&self) -> bool
pub fn set_hovered(&mut self, hovered: bool)
pub fn label(&self) -> String
pub fn set_label(&mut self, label: String)
Trait Implementations§
Source§impl<'de, N, E, Ty, Ix, D> Deserialize<'de> for Node<N, E, Ty, Ix, D>where
N: Clone + Deserialize<'de>,
E: Clone,
Ty: EdgeType,
Ix: IndexType + Deserialize<'de>,
D: DisplayNode<N, E, Ty, Ix> + Deserialize<'de>,
impl<'de, N, E, Ty, Ix, D> Deserialize<'de> for Node<N, E, Ty, Ix, D>where
N: Clone + Deserialize<'de>,
E: Clone,
Ty: EdgeType,
Ix: IndexType + Deserialize<'de>,
D: DisplayNode<N, E, Ty, Ix> + Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<N, E, Ty, Ix, D> Freeze for Node<N, E, Ty, Ix, D>
impl<N, E, Ty, Ix, D> RefUnwindSafe for Node<N, E, Ty, Ix, D>
impl<N, E, Ty, Ix, D> Send for Node<N, E, Ty, Ix, D>
impl<N, E, Ty, Ix, D> Sync for Node<N, E, Ty, Ix, D>
impl<N, E, Ty, Ix, D> Unpin for Node<N, E, Ty, Ix, D>
impl<N, E, Ty, Ix, D> UnsafeUnpin for Node<N, E, Ty, Ix, D>
impl<N, E, Ty, Ix, D> UnwindSafe for Node<N, E, Ty, Ix, D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more