pub struct CustomNode<'a> {
pub label: &'a str,
pub width: usize,
pub height: usize,
pub painter: Option<NodePaintFn>,
pub payload: &'a str,
}Expand description
The explicit five-field custom-node form, for callers who want no trait impl of their own.
Fields§
§label: &'a strLabel (legends, JSON, debug).
width: usizeReserved width in cells.
height: usizeReserved height in rows.
painter: Option<NodePaintFn>Template fn; None = blank (area reserved, nothing painted).
payload: &'a strData delivered to the painter via NodePaintCtx.
Trait Implementations§
Source§impl<'a> Clone for CustomNode<'a>
impl<'a> Clone for CustomNode<'a>
Source§fn clone(&self) -> CustomNode<'a>
fn clone(&self) -> CustomNode<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for CustomNode<'a>
Source§impl<'a> Debug for CustomNode<'a>
impl<'a> Debug for CustomNode<'a>
Source§impl<'a> NodeContent<'a> for CustomNode<'a>
impl<'a> NodeContent<'a> for CustomNode<'a>
Source§fn size(&self) -> (usize, usize)
fn size(&self) -> (usize, usize)
Reserved
(width, height) in cells/rows. Layout routes edges
around this area; the painter fills it.Source§fn painter(&self) -> Option<NodePaintFn>
fn painter(&self) -> Option<NodePaintFn>
The template fn that fills the reserved area, if any.
Source§fn payload(&self) -> &'a str
fn payload(&self) -> &'a str
Data for the painter: travels like a second label, delivered
via
NodePaintCtx at paint time
and exported to JSON as "payload" on custom nodes.Auto Trait Implementations§
impl<'a> Freeze for CustomNode<'a>
impl<'a> RefUnwindSafe for CustomNode<'a>
impl<'a> Send for CustomNode<'a>
impl<'a> Sync for CustomNode<'a>
impl<'a> Unpin for CustomNode<'a>
impl<'a> UnsafeUnpin for CustomNode<'a>
impl<'a> UnwindSafe for CustomNode<'a>
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