Struct TileSet

Source
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

Source

pub const PAGES: &'static str = "pages"

Source

pub const COLLIDERS: &'static str = "colliders"

Source

pub const PROPERTIES: &'static str = "properties"

Source§

impl TileSet

Source

pub fn collider_color(&self, uuid: Uuid) -> Option<Color>

The color of the collider layer with the given uuid.

Source

pub fn tile_collider( &self, handle: TileDefinitionHandle, uuid: Uuid, ) -> &TileCollider

The collider of the given tile.

Source

pub fn tile_color(&self, handle: TileDefinitionHandle) -> Option<Color>

The color of the given tile.

Source

pub fn tile_data(&self, handle: TileDefinitionHandle) -> Option<&TileData>

The data of the given tile.

Source

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.

Source

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.

Source

pub fn keys_on_page(&self, page: Vector2<i32>) -> Vec<Vector2<i32>>

Generate a list of all tile positions in the given page.

Source

pub fn page_keys(&self) -> Vec<Vector2<i32>>

Generate a list of all page positions.

Source

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.

Source

pub fn page_icon(&self, page: Vector2<i32>) -> Option<TileDefinitionHandle>

The handle of the icon that represents the given page.

Source

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.

Source

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.

Source

pub fn find_property_by_name( &self, property_name: &ImmutableString, ) -> Option<&TileSetPropertyLayer>

Find a property layer by its name.

Source

pub fn find_property(&self, uuid: Uuid) -> Option<&TileSetPropertyLayer>

Find a property layer by its UUID.

Source

pub fn find_property_mut( &mut self, uuid: Uuid, ) -> Option<&mut TileSetPropertyLayer>

Find a property layer by its UUID.

Source

pub fn find_collider(&self, uuid: Uuid) -> Option<&TileSetColliderLayer>

Find a collider layer by its UUID.

Source

pub fn find_collider_mut( &mut self, uuid: Uuid, ) -> Option<&mut TileSetColliderLayer>

Find a collider layer by its UUID.

Source

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.

Source

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.

Source

pub fn preview_texture(&self) -> Option<TextureResource>

Find a texture from some material page to serve as a preview for the tile set.

Source

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.

Source

pub fn get_page(&self, position: Vector2<i32>) -> Option<&TileSetPage>

Get the page at the given position.

Source

pub fn get_page_mut( &mut self, position: Vector2<i32>, ) -> Option<&mut TileSetPage>

Get the page at the given position.

Source

pub fn insert_page( &mut self, position: Vector2<i32>, page: TileSetPage, ) -> Option<TileSetPage>

Insert the given page at the given position.

Source

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.

Source

pub fn is_valid_tile(&self, handle: TileDefinitionHandle) -> bool

Returns true if the given handle points to a tile definition.

Source

pub fn get_abstract_tile( &self, page: Vector2<i32>, tile: Vector2<i32>, ) -> Option<AbstractTile>

The tile at the given page and tile coordinates.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn palette_iterator( &self, stage: TilePaletteStage, page: Vector2<i32>, ) -> TileSetPaletteIterator<'_>

An iterator over the TileDefinitionHandle of each tile on the given page.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn get_tile_bounds( &self, position: ResourceTilePosition, ) -> Option<TileMaterialBounds>

Get the tile definition at the given position.

Source

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.

Source

pub fn get_tile_data(&self, position: ResourceTilePosition) -> Option<&TileData>

Get the tile definition at the given position.

Source

pub fn get_tile_data_mut( &mut self, handle: TileDefinitionHandle, ) -> Option<&mut TileData>

Get the tile definition at the given position.

Source

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.

Source

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.

Source

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.

Source

pub fn pages_bounds(&self) -> OptionTileRect

The bounding rect of the pages.

Source

pub fn tiles_bounds( &self, stage: TilePaletteStage, page: Vector2<i32>, ) -> OptionTileRect

The bounding rect of the tiles of the given page.

Source

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.

Source

pub fn is_free_at(&self, position: ResourceTilePosition) -> bool

Returns true if the tile set is unoccupied at the given position.

Source

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.

Source

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.

Source

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 Clone for TileSet

Source§

fn clone(&self) -> TileSet

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ComponentProvider for TileSet

Source§

fn query_component_ref(&self, type_id: TypeId) -> Option<&dyn Any>

Allows an object to provide access to inner components.
Source§

fn query_component_mut(&mut self, type_id: TypeId) -> Option<&mut dyn Any>

Allows an object to provide access to inner components.
Source§

impl Debug for TileSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TileSet

Source§

fn default() -> TileSet

Returns the “default value” for a type. Read more
Source§

impl Reflect for TileSet

Source§

fn source_path() -> &'static str

Source§

fn type_name(&self) -> &'static str

Source§

fn doc(&self) -> &'static str

Source§

fn assembly_name(&self) -> &'static str

Returns a parent assembly name of the type that implements this trait. WARNING: You should use proc-macro (#[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

Returns a parent assembly name of the type that implements this trait. WARNING: You should use proc-macro (#[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 fields_info(&self, func: &mut dyn FnMut(&[FieldInfo<'_, '_>]))

Source§

fn into_any(self: Box<Self>) -> Box<dyn Any>

Source§

fn set( &mut self, value: Box<dyn Reflect>, ) -> Result<Box<dyn Reflect>, Box<dyn Reflect>>

Source§

fn as_any(&self, func: &mut dyn FnMut(&dyn Any))

Source§

fn as_any_mut(&mut self, func: &mut dyn FnMut(&mut dyn Any))

Source§

fn as_reflect(&self, func: &mut dyn FnMut(&dyn Reflect))

Source§

fn as_reflect_mut(&mut self, func: &mut dyn FnMut(&mut dyn Reflect))

Source§

fn fields(&self, func: &mut dyn FnMut(&[&dyn Reflect]))

Source§

fn fields_mut(&mut self, func: &mut dyn FnMut(&mut [&mut dyn Reflect]))

Source§

fn field(&self, name: &str, func: &mut dyn FnMut(Option<&dyn Reflect>))

Source§

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>>), )

Calls user method specified with #[reflect(setter = ..)] or falls back to Reflect::field_mut
Source§

fn as_array(&self, func: &mut dyn FnMut(Option<&(dyn ReflectArray + 'static)>))

Source§

fn as_array_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectArray + 'static)>), )

Source§

fn as_list(&self, func: &mut dyn FnMut(Option<&(dyn ReflectList + 'static)>))

Source§

fn as_list_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectList + 'static)>), )

Source§

fn as_inheritable_variable( &self, func: &mut dyn FnMut(Option<&(dyn ReflectInheritableVariable + 'static)>), )

Source§

fn as_inheritable_variable_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectInheritableVariable + 'static)>), )

Source§

fn as_hash_map( &self, func: &mut dyn FnMut(Option<&(dyn ReflectHashMap + 'static)>), )

Source§

fn as_hash_map_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectHashMap + 'static)>), )

Source§

impl ResourceData for TileSet

Source§

fn type_uuid(&self) -> Uuid

Returns unique data type id.
Source§

fn save(&mut self, path: &Path) -> Result<(), Box<dyn Error>>

Saves the resource data a file at the specified path. This method is free to decide how the resource data is saved. This is needed, because there are multiple formats that defines various kinds of resources. For example, a rectangular texture could be saved into a bunch of formats, such as png, bmp, tga, jpg etc., but in the engine it is single Texture resource. In any case, produced file should be compatible with a respective resource loader.
Source§

fn can_be_saved(&self) -> bool

Returns 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 TypeUuidProvider for TileSet

Source§

fn type_uuid() -> Uuid

Return type UUID.
Source§

impl Visit for TileSet

Source§

fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult

Read or write this value, depending on whether Visitor::is_reading() is true or false. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsyncTaskResult for T
where T: Any + Send + 'static,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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 T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts self reference as a reference to Any. Could be used to downcast a trait object to a particular type.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts self reference as a reference to Any. Could be used to downcast a trait object to a particular type.
Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> FieldValue for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Casts self to a &dyn Any
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<R> GetField for R
where R: Reflect,

Source§

fn get_field<T>(&self, name: &str, func: &mut dyn FnMut(Option<&T>))
where T: 'static,

Source§

fn get_field_mut<T>(&mut self, name: &str, func: &mut dyn FnMut(Option<&mut T>))
where T: 'static,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> ReflectBase for T
where T: Reflect,

Source§

fn as_any_raw(&self) -> &(dyn Any + 'static)

Source§

fn as_any_raw_mut(&mut self) -> &mut (dyn Any + 'static)

Source§

impl<T> ResolvePath for T
where T: Reflect,

Source§

fn resolve_path<'p>( &self, path: &'p str, func: &mut dyn FnMut(Result<&(dyn Reflect + 'static), ReflectPathError<'p>>), )

Source§

fn resolve_path_mut<'p>( &mut self, path: &'p str, func: &mut dyn FnMut(Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>), )

Source§

fn get_resolve_path<'p, T>( &self, path: &'p str, func: &mut dyn FnMut(Result<&T, ReflectPathError<'p>>), )
where T: Reflect,

Source§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ScriptMessagePayload for T
where T: 'static + Send + Debug,

Source§

fn as_any_ref(&self) -> &(dyn Any + 'static)

Returns self as &dyn Any
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Returns self as &dyn Any
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Value for T
where T: Reflect + Clone + Debug + Send,

Source§

fn clone_box(&self) -> Box<dyn Value>

Source§

fn into_box_reflect(self: Box<T>) -> Box<dyn Reflect>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> CollectionItem for T
where T: Clone + Reflect + Debug + Default + TypeUuidProvider + Send + 'static,

Source§

impl<T> InspectableEnum for T
where T: Debug + Reflect + Clone + TypeUuidProvider + Send + 'static,

Source§

impl<T> ResourceLoadError for T
where T: 'static + Debug + Send + Sync,

Source§

impl<T> TypedResourceData for T