Skip to main content

ExtraForce

Trait ExtraForce 

Source
pub trait ExtraForce:
    Debug
    + Default
    + Send
    + Sync
    + 'static {
    type Params: Serialize + DeserializeOwned + Clone + Default + Debug + Send + Sync + 'static;

    // Required method
    fn apply<N, E, Ty, Ix, Dn, De>(
        params: &Self::Params,
        g: &Graph<N, E, Ty, Ix, Dn, De>,
        indices: &[NodeIndex<Ix>],
        disp: &mut [Vec2],
        area: Rect,
        k: f32,
    )
       where N: Clone,
             E: Clone,
             Ty: EdgeType,
             Ix: IndexType,
             Dn: DisplayNode<N, E, Ty, Ix>,
             De: DisplayEdge<N, E, Ty, Ix, Dn>;
}
Expand description

An additional force to be applied after the base forces. Implementors are zero-sized marker types with the behavior in apply.

Required Associated Types§

Required Methods§

Source

fn apply<N, E, Ty, Ix, Dn, De>( params: &Self::Params, g: &Graph<N, E, Ty, Ix, Dn, De>, indices: &[NodeIndex<Ix>], disp: &mut [Vec2], area: Rect, k: f32, )
where N: Clone, E: Clone, Ty: EdgeType, Ix: IndexType, Dn: DisplayNode<N, E, Ty, Ix>, De: DisplayEdge<N, E, Ty, Ix, Dn>,

Apply the extra force: accumulate into disp (same convention as base helpers).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§