Skip to main content

Geometry

Trait Geometry 

Source
pub trait Geometry: Clone {
    // Required methods
    fn init_view(&self, view: &mut GeometryView);
    fn update_view(&self, view: &mut GeometryView);

    // Provided method
    fn update(&mut self) { ... }
}
Expand description

A trait for objects that can both initialize and update a GeometryView.

Types implementing this trait can:

  • Create a complete geometry view from scratch
  • Modify an existing geometry view
  • Are cloneable to support duplication of geometric data.

§Required Trait Bounds

  • Clone: For copying geometric data

Required Methods§

Source

fn init_view(&self, view: &mut GeometryView)

Initializes a new GeometryView.

Source

fn update_view(&self, view: &mut GeometryView)

Updates an existing GeometryView with this object’s data.

Provided Methods§

Source

fn update(&mut self)

Updates self before updating geometry view, optional.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§