pub trait Structure: Any {
Show 14 methods
// Provided methods
fn as_dyn_impl(x: &dyn Any) -> &dyn Structure
where Self: Sized { ... }
fn as_dyn_outer(&self) -> Option<(&dyn Structure, &'static str)> { ... }
fn as_dyn(&self) -> &(impl Structure + ?Sized)
where Self: Sized { ... }
fn render_inner(&self, _site: &Site, _land: &Land<'_>, _painter: &Painter) { ... }
fn render(&self, site: &Site, land: &Land<'_>, painter: &Painter)
where Self: Sized { ... }
fn spawn_rules_inner(
&self,
_spawn_rules: &mut SpawnRules,
_land: &Land<'_>,
_wpos: Vec2<i32>,
_weight: f32,
) { ... }
fn spawn_rules(
&self,
spawn_rules: &mut SpawnRules,
land: &Land<'_>,
wpos: Vec2<i32>,
weight: f32,
)
where Self: Sized { ... }
fn render_collect(
&self,
site: &Site,
canvas: &CanvasInfo<'_>,
) -> (Store<Primitive>, Vec<(Id<Primitive>, Fill)>, Vec<EntityInfo>)
where Self: Sized { ... }
fn rel_terrain_offset(&self, col: &ColumnSample<'_>) -> i32 { ... }
fn terrain_surface_at_inner(
&self,
_wpos: Vec2<i32>,
_old: Block,
_rng: &mut ChaCha8Rng,
_col: &ColumnSample<'_>,
_z_off: i32,
_site: &Site,
) -> Option<Block> { ... }
fn terrain_surface_at(
&self,
wpos: Vec2<i32>,
old: Block,
rng: &mut ChaCha8Rng,
col: &ColumnSample<'_>,
z_off: i32,
site: &Site,
) -> Option<Block>
where Self: Sized { ... }
fn airship_dock_info(&self) -> Option<AirshipDockInfo<'_>> { ... }
fn door_tile(&self) -> Option<Vec2<i32>> { ... }
fn render_ordering(&self) -> u32 { ... }
}Provided Methods§
fn as_dyn_impl(x: &dyn Any) -> &dyn Structurewhere
Self: Sized,
Sourcefn as_dyn_outer(&self) -> Option<(&dyn Structure, &'static str)>
fn as_dyn_outer(&self) -> Option<(&dyn Structure, &'static str)>
Defaults to no support for hot linking.
Overload this function and provide a unique export_name (as
demonstrated by existing plots) to have the plot support
hot-reloading.
fn as_dyn(&self) -> &(impl Structure + ?Sized)where
Self: Sized,
fn render_inner(&self, _site: &Site, _land: &Land<'_>, _painter: &Painter)
fn render(&self, site: &Site, land: &Land<'_>, painter: &Painter)where
Self: Sized,
fn spawn_rules_inner( &self, _spawn_rules: &mut SpawnRules, _land: &Land<'_>, _wpos: Vec2<i32>, _weight: f32, )
fn spawn_rules(
&self,
spawn_rules: &mut SpawnRules,
land: &Land<'_>,
wpos: Vec2<i32>,
weight: f32,
)where
Self: Sized,
fn render_collect(
&self,
site: &Site,
canvas: &CanvasInfo<'_>,
) -> (Store<Primitive>, Vec<(Id<Primitive>, Fill)>, Vec<EntityInfo>)where
Self: Sized,
Sourcefn rel_terrain_offset(&self, col: &ColumnSample<'_>) -> i32
fn rel_terrain_offset(&self, col: &ColumnSample<'_>) -> i32
What z_off in terrain_surface_at should be relative to for each
column.
fn terrain_surface_at_inner( &self, _wpos: Vec2<i32>, _old: Block, _rng: &mut ChaCha8Rng, _col: &ColumnSample<'_>, _z_off: i32, _site: &Site, ) -> Option<Block>
fn terrain_surface_at(
&self,
wpos: Vec2<i32>,
old: Block,
rng: &mut ChaCha8Rng,
col: &ColumnSample<'_>,
z_off: i32,
site: &Site,
) -> Option<Block>where
Self: Sized,
fn airship_dock_info(&self) -> Option<AirshipDockInfo<'_>>
fn door_tile(&self) -> Option<Vec2<i32>>
fn render_ordering(&self) -> u32
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".