pub struct TileSet {
pub pages: FxHashMap<Vector2<i32>, TileSetPage>,
pub colliders: Vec<TileSetColliderLayer>,
pub properties: Vec<TileSetPropertyLayer>,
pub change_count: ChangeFlag,
/* private fields */
}
Expand description
Tile set is a special storage for tile descriptions. It is a sort of database, that contains descriptions (definitions) for tiles. Such approach allows you to change appearance of all tiles of particular kind at once.
The tile data of the tile set is divided into pages, and pages come in three different types depending
on what kind of data is stored on the page. See TileSetPage
for more information about the
page variants.
A tile set also contains extra layers of data that may be included with each tile: Collider layers and property layers.
A property layer allows a particular value to be assigned to each tile.
The each layer has a name and a data type for the value, and it may optionally have
a list of pre-defined values and names for each of the pre-defined values.
This makes it easier to keep track of values which may have special meanings
when editing the tile set. See TileSetPropertyLayer
for more information.
A collider layer allows a shape to be assigned to each tile for the purpose of
constructing a physics object for the tile map.
Each layer has a name and a color. The color is used to allow the user to quickly
identify which shapes correspond to which layers while in the tile set editor.
See TileSetColliderLayer
for more information.
Fields§
§pages: FxHashMap<Vector2<i32>, TileSetPage>
The set of pages, organized by position.
colliders: Vec<TileSetColliderLayer>
Collider layers, in the order in which the layers should be presented in the editor.
properties: Vec<TileSetPropertyLayer>
Property types in the order in which the layers should be presented in the editor.
change_count: ChangeFlag
A count of changes since last save. New changes add +1. Reverting to previous states add -1. Reverting to a state before the last save can result in negative values. Saving is unnecessary whenever this value is 0.
Implementations§
Source§impl TileSet
impl TileSet
Sourcepub fn collider_color(&self, uuid: Uuid) -> Option<Color>
pub fn collider_color(&self, uuid: Uuid) -> Option<Color>
The color of the collider layer with the given uuid.
Sourcepub fn tile_collider(
&self,
handle: TileDefinitionHandle,
uuid: Uuid,
) -> &TileCollider
pub fn tile_collider( &self, handle: TileDefinitionHandle, uuid: Uuid, ) -> &TileCollider
The collider of the given tile.
Sourcepub fn tile_color(&self, handle: TileDefinitionHandle) -> Option<Color>
pub fn tile_color(&self, handle: TileDefinitionHandle) -> Option<Color>
The color of the given tile.
Sourcepub fn tile_data(&self, handle: TileDefinitionHandle) -> Option<&TileData>
pub fn tile_data(&self, handle: TileDefinitionHandle) -> Option<&TileData>
The data of the given tile.
Sourcepub fn tile_bounds(
&self,
handle: TileDefinitionHandle,
) -> Option<&TileMaterialBounds>
pub fn tile_bounds( &self, handle: TileDefinitionHandle, ) -> Option<&TileMaterialBounds>
The material and bounds of the given tile, if it stores its own material and bounds because it is a freeform tile.
Sourcepub fn tile_redirect(
&self,
handle: TileDefinitionHandle,
) -> Option<TileDefinitionHandle>
pub fn tile_redirect( &self, handle: TileDefinitionHandle, ) -> Option<TileDefinitionHandle>
The redirect target of the given tile. When a tile set tile does not contain its own data, but instead it points toward a tile elsewhere in the set, this method returns the TileDefinitionHandle of that other tile.
Sourcepub fn keys_on_page(&self, page: Vector2<i32>) -> Vec<Vector2<i32>> ⓘ
pub fn keys_on_page(&self, page: Vector2<i32>) -> Vec<Vector2<i32>> ⓘ
Generate a list of all tile positions in the given page.
Sourcepub fn has_tile_at(&self, page: Vector2<i32>, tile: Vector2<i32>) -> bool
pub fn has_tile_at(&self, page: Vector2<i32>, tile: Vector2<i32>) -> bool
True if there is a tile at the given position on the given page.
Sourcepub fn page_icon(&self, page: Vector2<i32>) -> Option<TileDefinitionHandle>
pub fn page_icon(&self, page: Vector2<i32>) -> Option<TileDefinitionHandle>
The handle of the icon that represents the given page.
Sourcepub fn property_name_to_uuid(&self, name: &ImmutableString) -> Option<Uuid>
pub fn property_name_to_uuid(&self, name: &ImmutableString) -> Option<Uuid>
Get the UUID of the property with the given name, if that property exists.
Sourcepub fn collider_name_to_uuid(&self, name: &ImmutableString) -> Option<Uuid>
pub fn collider_name_to_uuid(&self, name: &ImmutableString) -> Option<Uuid>
Get the UUID of the collider with the given name, if that collider exists.
Sourcepub fn find_property_by_name(
&self,
property_name: &ImmutableString,
) -> Option<&TileSetPropertyLayer>
pub fn find_property_by_name( &self, property_name: &ImmutableString, ) -> Option<&TileSetPropertyLayer>
Find a property layer by its name.
Sourcepub fn find_property(&self, uuid: Uuid) -> Option<&TileSetPropertyLayer>
pub fn find_property(&self, uuid: Uuid) -> Option<&TileSetPropertyLayer>
Find a property layer by its UUID.
Sourcepub fn find_property_mut(
&mut self,
uuid: Uuid,
) -> Option<&mut TileSetPropertyLayer>
pub fn find_property_mut( &mut self, uuid: Uuid, ) -> Option<&mut TileSetPropertyLayer>
Find a property layer by its UUID.
Sourcepub fn find_collider(&self, uuid: Uuid) -> Option<&TileSetColliderLayer>
pub fn find_collider(&self, uuid: Uuid) -> Option<&TileSetColliderLayer>
Find a collider layer by its UUID.
Sourcepub fn find_collider_mut(
&mut self,
uuid: Uuid,
) -> Option<&mut TileSetColliderLayer>
pub fn find_collider_mut( &mut self, uuid: Uuid, ) -> Option<&mut TileSetColliderLayer>
Find a collider layer by its UUID.
Sourcepub fn rebuild_transform_sets(&mut self)
pub fn rebuild_transform_sets(&mut self)
Iterate through the tiles of every transform set page and establish the connection between the tiles of other pages and their corresponding position in a transform set page. This should happen after any transform set is changed and before it is next used.
Sourcepub fn rebuild_animations(&mut self)
pub fn rebuild_animations(&mut self)
Iterate through the tiles of every animation page and establish the connection between the tiles of other pages and their corresponding position in an animation page. This should happen after any animation page is changed and before it is next used.
If a tile appears in multiple animation pages, the pages with greater y-coordinate are prioritized, followed by prioritizing lower x-coordinate. If a tile appears more than once on the same page, the cell with greater y-coordinate is prioritized, followed by lower x-coordinate. In this way a unique animation is always chosen for every tile that appears on any animation page.
Sourcepub fn preview_texture(&self) -> Option<TextureResource>
pub fn preview_texture(&self) -> Option<TextureResource>
Find a texture from some material page to serve as a preview for the tile set.
Sourcepub fn swap(&mut self, update: &mut TileSetUpdate)
pub fn swap(&mut self, update: &mut TileSetUpdate)
Update the tile set using data stored in the given TileSetUpdate
and modify the TileSetUpdate
to become the reverse of the changes by storing
the data that was removed from this TileSet.
rebuild_transform_sets
is automatically called if a transform set page is
modified.
rebuild_animations
is automatically called if an animation page is
modified.
Wherever there is incompatibility between the tile set and the given update,
the tile set should gracefully ignore that part of the update, log the error,
and set the update to TileDataUpdate::DoNothing
, because that is the correct
reversal of nothing being done.
Sourcepub fn get_page(&self, position: Vector2<i32>) -> Option<&TileSetPage>
pub fn get_page(&self, position: Vector2<i32>) -> Option<&TileSetPage>
Get the page at the given position.
Sourcepub fn get_page_mut(
&mut self,
position: Vector2<i32>,
) -> Option<&mut TileSetPage>
pub fn get_page_mut( &mut self, position: Vector2<i32>, ) -> Option<&mut TileSetPage>
Get the page at the given position.
Sourcepub fn insert_page(
&mut self,
position: Vector2<i32>,
page: TileSetPage,
) -> Option<TileSetPage>
pub fn insert_page( &mut self, position: Vector2<i32>, page: TileSetPage, ) -> Option<TileSetPage>
Insert the given page at the given position.
Sourcepub fn remove_page(&mut self, position: Vector2<i32>) -> Option<TileSetPage>
pub fn remove_page(&mut self, position: Vector2<i32>) -> Option<TileSetPage>
Remove the page at the given position, if there is a page at that position.
Sourcepub fn is_valid_tile(&self, handle: TileDefinitionHandle) -> bool
pub fn is_valid_tile(&self, handle: TileDefinitionHandle) -> bool
Returns true if the given handle points to a tile definition.
Sourcepub fn get_abstract_tile(
&self,
page: Vector2<i32>,
tile: Vector2<i32>,
) -> Option<AbstractTile>
pub fn get_abstract_tile( &self, page: Vector2<i32>, tile: Vector2<i32>, ) -> Option<AbstractTile>
The tile at the given page and tile coordinates.
Sourcepub fn set_abstract_tile(
&mut self,
page: Vector2<i32>,
tile: Vector2<i32>,
value: Option<AbstractTile>,
) -> Option<AbstractTile>
pub fn set_abstract_tile( &mut self, page: Vector2<i32>, tile: Vector2<i32>, value: Option<AbstractTile>, ) -> Option<AbstractTile>
Put the given tile into the cell at the given page and tile coordinates.
Sourcepub fn get_transformed_render_data(
&self,
trans: OrthoTransformation,
handle: TileDefinitionHandle,
) -> Option<TileRenderData>
pub fn get_transformed_render_data( &self, trans: OrthoTransformation, handle: TileDefinitionHandle, ) -> Option<TileRenderData>
The render data for the tile at the given handle after applying the transform.
Sourcepub fn get_tile_render_data(
&self,
position: ResourceTilePosition,
) -> Option<TileRenderData>
pub fn get_tile_render_data( &self, position: ResourceTilePosition, ) -> Option<TileRenderData>
Return the TileRenderData
needed to render the tile at the given handle.
The handle is redirected if it refers to a reference to another tile.
If a reference is redirected and the resulting handle does not point to a tile definition,
then TileRenderData::missing_tile()
is returned to that an error tile will be rendered.
If the given handle does not point to a reference and it does not point to a tile definition,
then None is returned since nothing should be rendered.
Sourcepub fn get_tile_collider(
&self,
handle: TileDefinitionHandle,
uuid: Uuid,
) -> Option<&TileCollider>
pub fn get_tile_collider( &self, handle: TileDefinitionHandle, uuid: Uuid, ) -> Option<&TileCollider>
The tile collider with the given UUID for the tile at the given handle.
Sourcepub fn palette_iterator(
&self,
stage: TilePaletteStage,
page: Vector2<i32>,
) -> TileSetPaletteIterator<'_> ⓘ
pub fn palette_iterator( &self, stage: TilePaletteStage, page: Vector2<i32>, ) -> TileSetPaletteIterator<'_> ⓘ
An iterator over the TileDefinitionHandle
of each tile on the given page.
Sourcepub fn palette_render_loop<F>(
&self,
stage: TilePaletteStage,
page: Vector2<i32>,
func: F,
)
pub fn palette_render_loop<F>( &self, stage: TilePaletteStage, page: Vector2<i32>, func: F, )
Loop through the tiles of the given page and find the render data for each tile, then passes it to the given function.
Sourcepub fn tile_collider_loop<F>(&self, page: Vector2<i32>, func: F)
pub fn tile_collider_loop<F>(&self, page: Vector2<i32>, func: F)
Loop through the tiles of the given page and find each of the tile colliders on each tile, then pass the collider to the given function along with the collider’s UUID and color.
Sourcepub fn redirect_handle(
&self,
position: ResourceTilePosition,
) -> Option<TileDefinitionHandle>
pub fn redirect_handle( &self, position: ResourceTilePosition, ) -> Option<TileDefinitionHandle>
Some tiles in a tile set are references to tiles elsewhere in the tile set. In particular, the tiles of a transform set page all contain references to other pages, and the page tiles are also references. If this method is given the position of one of these reference tiles, then it returns the handle of the referenced tile. If the given position points to a tile without a redirect, then the tile’s handle is returned. If the given position points to a non-existent page or a non-existent tile, then None is returned.
Sourcepub fn get_transform_tile_source(
&self,
handle: TileDefinitionHandle,
) -> Option<TileDefinitionHandle>
pub fn get_transform_tile_source( &self, handle: TileDefinitionHandle, ) -> Option<TileDefinitionHandle>
If the given handle refers to a transform set page, find the tile on that page and return the handle of wherever the tile comes from originally. Return None if the page is not a transform set or there is no tile at that position.
Sourcepub fn get_definition(
&self,
handle: TileDefinitionHandle,
) -> Option<TileDefinition>
pub fn get_definition( &self, handle: TileDefinitionHandle, ) -> Option<TileDefinition>
Returns a clone of the full definition of the tile at the given handle, if possible. Use TileSet::get_tile_data if a clone is not needed.
Sourcepub fn get_transformed_definition(
&self,
trans: OrthoTransformation,
handle: TileDefinitionHandle,
) -> Option<TileDefinition>
pub fn get_transformed_definition( &self, trans: OrthoTransformation, handle: TileDefinitionHandle, ) -> Option<TileDefinition>
Return a copy of the definition of the tile at the given handle with the given transformation applied.
Sourcepub fn get_tile_bounds(
&self,
position: ResourceTilePosition,
) -> Option<TileMaterialBounds>
pub fn get_tile_bounds( &self, position: ResourceTilePosition, ) -> Option<TileMaterialBounds>
Get the tile definition at the given position.
Sourcepub fn property_value(
&self,
handle: TileDefinitionHandle,
property_id: Uuid,
) -> Option<TileSetPropertyValue>
pub fn property_value( &self, handle: TileDefinitionHandle, property_id: Uuid, ) -> Option<TileSetPropertyValue>
The value of the property with the given UUID for the given tile.
Sourcepub fn get_tile_data(&self, position: ResourceTilePosition) -> Option<&TileData>
pub fn get_tile_data(&self, position: ResourceTilePosition) -> Option<&TileData>
Get the tile definition at the given position.
Sourcepub fn get_tile_data_mut(
&mut self,
handle: TileDefinitionHandle,
) -> Option<&mut TileData>
pub fn get_tile_data_mut( &mut self, handle: TileDefinitionHandle, ) -> Option<&mut TileData>
Get the tile definition at the given position.
Sourcepub fn get_animated_version(
&self,
time: f32,
handle: TileDefinitionHandle,
) -> Option<TileDefinitionHandle>
pub fn get_animated_version( &self, time: f32, handle: TileDefinitionHandle, ) -> Option<TileDefinitionHandle>
The handle of the tile in the animation sequence starting from the given tile handle at the given time, or none if the given handle is not part of any animation sequence.
Sourcepub fn get_transformed_version(
&self,
transform: OrthoTransformation,
handle: TileDefinitionHandle,
) -> Option<TileDefinitionHandle>
pub fn get_transformed_version( &self, transform: OrthoTransformation, handle: TileDefinitionHandle, ) -> Option<TileDefinitionHandle>
Finds the handle of the tile that represents a transformed version of the tile at the given handle, if such a tile exists.
The given tile needs to have a transform_tile
in its data, that handle needs to point to a transform set page,
and that page needs to have a tile in the position corresponding to the desired transform relative to the transform_tile
position.
All 8 possible transforms are grouped together in 4x2 rectangles within each transform set page, and every transformation is possible
so long as all 8 cells are filled with tiles. Otherwise, None is returned.
Sourcepub fn get_tiles<I: Iterator<Item = Vector2<i32>>>(
&self,
stage: TilePaletteStage,
page: Vector2<i32>,
iter: I,
tiles: &mut Tiles,
)
pub fn get_tiles<I: Iterator<Item = Vector2<i32>>>( &self, stage: TilePaletteStage, page: Vector2<i32>, iter: I, tiles: &mut Tiles, )
Get the tile definition handles for all of the given coordinates on the given page.
Sourcepub fn pages_bounds(&self) -> OptionTileRect
pub fn pages_bounds(&self) -> OptionTileRect
The bounding rect of the pages.
Sourcepub fn tiles_bounds(
&self,
stage: TilePaletteStage,
page: Vector2<i32>,
) -> OptionTileRect
pub fn tiles_bounds( &self, stage: TilePaletteStage, page: Vector2<i32>, ) -> OptionTileRect
The bounding rect of the tiles of the given page.
Sourcepub async fn from_file(
path: &Path,
resource_manager: ResourceManager,
io: &dyn ResourceIo,
) -> Result<Self, TileSetResourceError>
pub async fn from_file( path: &Path, resource_manager: ResourceManager, io: &dyn ResourceIo, ) -> Result<Self, TileSetResourceError>
Load a tile set resource from the specific file path.
Sourcepub fn is_free_at(&self, position: ResourceTilePosition) -> bool
pub fn is_free_at(&self, position: ResourceTilePosition) -> bool
Returns true if the tile set is unoccupied at the given position.
Sourcepub fn find_free_location(
&self,
stage: TilePaletteStage,
page: Vector2<i32>,
position: Vector2<i32>,
) -> Vector2<i32>
pub fn find_free_location( &self, stage: TilePaletteStage, page: Vector2<i32>, position: Vector2<i32>, ) -> Vector2<i32>
Tries to find free location at the given position. It uses brute-force searching algorithm and could be slow if called dozens of time per frame or on a large tile set.
Sourcepub fn swap_all_values_for_property(
&mut self,
property_id: Uuid,
values: &mut FxHashMap<TileDefinitionHandle, TileSetPropertyValue>,
)
pub fn swap_all_values_for_property( &mut self, property_id: Uuid, values: &mut FxHashMap<TileDefinitionHandle, TileSetPropertyValue>, )
Take all the values for the property with the given id, remove them from the page, and put them into the given hash map. At the same time, take all the values from the given hash map and put them into the page.
Sourcepub fn swap_all_values_for_collider(
&mut self,
collider_id: Uuid,
values: &mut FxHashMap<TileDefinitionHandle, TileCollider>,
)
pub fn swap_all_values_for_collider( &mut self, collider_id: Uuid, values: &mut FxHashMap<TileDefinitionHandle, TileCollider>, )
Take all the colliders for the given collider id, remove them from the tile set, and put them into the given hash map. At the same time, take all the colliders from the given hash map and put them into the page.
Trait Implementations§
Source§impl ComponentProvider for TileSet
impl ComponentProvider for TileSet
Source§impl Reflect for TileSetwhere
Self: 'static,
FxHashMap<Vector2<i32>, TileSetPage>: Reflect,
Vec<TileSetColliderLayer>: Reflect,
Vec<TileSetPropertyLayer>: Reflect,
impl Reflect for TileSetwhere
Self: 'static,
FxHashMap<Vector2<i32>, TileSetPage>: Reflect,
Vec<TileSetColliderLayer>: Reflect,
Vec<TileSetPropertyLayer>: Reflect,
fn source_path() -> &'static str
fn type_name(&self) -> &'static str
fn doc(&self) -> &'static str
Source§fn assembly_name(&self) -> &'static str
fn assembly_name(&self) -> &'static str
#[derive(Reflect)]
) to ensure that this method will return correct assembly
name. In other words - there’s no guarantee, that any implementation other than proc-macro
will return a correct name of the assembly. Alternatively, you can use env!("CARGO_PKG_NAME")
as an implementation.Source§fn type_assembly_name() -> &'static str
fn type_assembly_name() -> &'static str
#[derive(Reflect)]
) to ensure that this method will return correct assembly
name. In other words - there’s no guarantee, that any implementation other than proc-macro
will return a correct name of the assembly. Alternatively, you can use env!("CARGO_PKG_NAME")
as an implementation.fn fields_info(&self, func: &mut dyn FnMut(&[FieldInfo<'_, '_>]))
fn into_any(self: Box<Self>) -> Box<dyn Any>
fn set( &mut self, value: Box<dyn Reflect>, ) -> Result<Box<dyn Reflect>, Box<dyn Reflect>>
fn as_any(&self, func: &mut dyn FnMut(&dyn Any))
fn as_any_mut(&mut self, func: &mut dyn FnMut(&mut dyn Any))
fn as_reflect(&self, func: &mut dyn FnMut(&dyn Reflect))
fn as_reflect_mut(&mut self, func: &mut dyn FnMut(&mut dyn Reflect))
fn fields(&self, func: &mut dyn FnMut(&[&dyn Reflect]))
fn fields_mut(&mut self, func: &mut dyn FnMut(&mut [&mut dyn Reflect]))
fn field(&self, name: &str, func: &mut dyn FnMut(Option<&dyn Reflect>))
fn field_mut( &mut self, name: &str, func: &mut dyn FnMut(Option<&mut dyn Reflect>), )
Source§fn set_field(
&mut self,
field: &str,
value: Box<dyn Reflect>,
func: &mut dyn FnMut(Result<Box<dyn Reflect>, Box<dyn Reflect>>),
)
fn set_field( &mut self, field: &str, value: Box<dyn Reflect>, func: &mut dyn FnMut(Result<Box<dyn Reflect>, Box<dyn Reflect>>), )
#[reflect(setter = ..)]
or falls back to
Reflect::field_mut
fn as_array(&self, func: &mut dyn FnMut(Option<&(dyn ReflectArray + 'static)>))
fn as_array_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectArray + 'static)>), )
fn as_list(&self, func: &mut dyn FnMut(Option<&(dyn ReflectList + 'static)>))
fn as_list_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectList + 'static)>), )
fn as_inheritable_variable( &self, func: &mut dyn FnMut(Option<&(dyn ReflectInheritableVariable + 'static)>), )
fn as_inheritable_variable_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectInheritableVariable + 'static)>), )
fn as_hash_map( &self, func: &mut dyn FnMut(Option<&(dyn ReflectHashMap + 'static)>), )
fn as_hash_map_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectHashMap + 'static)>), )
Source§impl ResourceData for TileSet
impl ResourceData for TileSet
Source§fn save(&mut self, path: &Path) -> Result<(), Box<dyn Error>>
fn save(&mut self, path: &Path) -> Result<(), Box<dyn Error>>
Source§fn can_be_saved(&self) -> bool
fn can_be_saved(&self) -> bool
true
if the resource data can be saved to a file, false
- otherwise. Not every
resource type supports saving, for example there might be temporary resource type that is
used only at runtime which does not need saving at all.Source§impl Visit for TileSetwhere
FxHashMap<Vector2<i32>, TileSetPage>: Visit,
Vec<TileSetColliderLayer>: Visit,
Vec<TileSetPropertyLayer>: Visit,
impl Visit for TileSetwhere
FxHashMap<Vector2<i32>, TileSetPage>: Visit,
Vec<TileSetColliderLayer>: Visit,
Vec<TileSetPropertyLayer>: Visit,
Source§fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult
fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult
Auto Trait Implementations§
impl Freeze for TileSet
impl !RefUnwindSafe for TileSet
impl Send for TileSet
impl Sync for TileSet
impl Unpin for TileSet
impl !UnwindSafe for TileSet
Blanket Implementations§
Source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.fn into_any(self: Box<T>) -> Box<dyn Any>
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.Source§impl<T> ReflectBase for Twhere
T: Reflect,
impl<T> ReflectBase for Twhere
T: Reflect,
fn as_any_raw(&self) -> &(dyn Any + 'static)
fn as_any_raw_mut(&mut self) -> &mut (dyn Any + 'static)
Source§impl<T> ResolvePath for Twhere
T: Reflect,
impl<T> ResolvePath for Twhere
T: Reflect,
fn resolve_path<'p>( &self, path: &'p str, func: &mut dyn FnMut(Result<&(dyn Reflect + 'static), ReflectPathError<'p>>), )
fn resolve_path_mut<'p>( &mut self, path: &'p str, func: &mut dyn FnMut(Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>), )
fn get_resolve_path<'p, T>(
&self,
path: &'p str,
func: &mut dyn FnMut(Result<&T, ReflectPathError<'p>>),
)where
T: Reflect,
fn get_resolve_path_mut<'p, T>(
&mut self,
path: &'p str,
func: &mut dyn FnMut(Result<&mut T, ReflectPathError<'p>>),
)where
T: Reflect,
Source§impl<T> ScriptMessagePayload for T
impl<T> ScriptMessagePayload for T
Source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
self
as &dyn Any
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
self
as &dyn Any
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.