pub struct Node<N> {
pub name: String,
pub data: N,
pub location: Vec3,
pub velocity: Vec3,
pub color: [u8; 4],
pub locked: bool,
}
Expand description
A node on a ForceGraph
.
Fields
name: String
The name of the node.
data: N
Any arbitrary information you want to store within it.
location: Vec3
Location of the node.
velocity: Vec3
Velocity of the node.
color: [u8; 4]
Color of the node in RGBA.
locked: bool
If the node is locked. (if the physics should run on it)
Implementations
sourceimpl<N> Node<N>
impl<N> Node<N>
sourcepub fn new(name: impl AsRef<str>, data: N) -> Self
pub fn new(name: impl AsRef<str>, data: N) -> Self
Create a new node with it’s name and associated data.
sourcepub fn new_with_color(name: impl AsRef<str>, data: N, color: [u8; 4]) -> Self
pub fn new_with_color(name: impl AsRef<str>, data: N, color: [u8; 4]) -> Self
Create a new node with a custom color.
sourcepub fn new_with_coords(name: impl AsRef<str>, data: N, location: Vec3) -> Self
pub fn new_with_coords(name: impl AsRef<str>, data: N, location: Vec3) -> Self
Create a new node with custom coordinates.
Trait Implementations
impl<N> StructuralPartialEq for Node<N>
Auto Trait Implementations
impl<N> RefUnwindSafe for Node<N> where
N: RefUnwindSafe,
impl<N> Send for Node<N> where
N: Send,
impl<N> Sync for Node<N> where
N: Sync,
impl<N> Unpin for Node<N> where
N: Unpin,
impl<N> UnwindSafe for Node<N> where
N: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more