Skip to main content

PartSource

Trait PartSource 

Source
pub trait PartSource {
    // Required methods
    fn plan(
        &mut self,
        world: &World,
        boxes: &dyn Fn(Entity) -> Option<[[f64; 3]; 2]>,
    ) -> Result<()>;
    fn next_part(&mut self) -> Result<Option<Part>>;

    // Provided methods
    fn written(&mut self, _part: &World) -> Result<()> { ... }
    fn restart(&mut self) -> Result<()> { ... }
}
Expand description

How a conversion divides the selected world into parts.

Required Methods§

Source

fn plan( &mut self, world: &World, boxes: &dyn Fn(Entity) -> Option<[[f64; 3]; 2]>, ) -> Result<()>

Plan from the selected world, its geometry not loaded yet: boxes gives a prototype’s box (core frame) where the reader knows it.

Source

fn next_part(&mut self) -> Result<Option<Part>>

The next part to load, None when every part is done.

Provided Methods§

Source

fn written(&mut self, _part: &World) -> Result<()>

The part just asked for, as the writer got it: for a source that refines its plan from loaded geometry.

Source

fn restart(&mut self) -> Result<()>

Give the same parts again, from the first, as planned (convert_parts_summarized goes over them twice). A source that cannot (its parts depend on what was written) refuses.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§