### Rust Search Examples: Vectors, Type Casting, Option and Function Composition Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/render/struct.UvMappingHandle_search= Provides examples of common search queries used in Rust development, illustrating how to find information related to standard library types like vectors, type conversions (u32 to bool), and functional programming patterns involving Option and function composition. ```rust * std::vec ``` ```rust * u32 -> bool ``` ```rust * Option, (T -> U) -> Option ``` -------------------------------- ### Rust API Search Examples Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/terminal/struct.Terminal_search= Provides example search queries for exploring the Rust API. These examples cover common search patterns such as finding specific types, function signatures, and generic type transformations. ```text Example searches: * std::vec * u32 -> bool * Option, (T -> U) -> Option ``` -------------------------------- ### Search Functionality Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/render/struct.UvMappingHandle_search= Provides examples of search queries that can be used within the Bevy ASCII Terminal project. ```APIDOC ## Search Examples ### Example Searches - `std::vec` - `u32 -> bool` - `Option, (T -> U) -> Option` ``` -------------------------------- ### GET /api/terminal/read_line Source: https://docs.rs/bevy_ascii_terminal/latest/src/bevy_ascii_terminal/terminal.rs_search=u32+-%3E+bool Reads a line of characters from the terminal starting at a given position. ```APIDOC ## GET /api/terminal/read_line ### Description Reads a sequence of characters from the terminal grid, starting at a specified position and extending for a given width. The reading process respects the terminal's layout and character data. ### Method GET ### Endpoint `/api/terminal/read_line` ### Parameters #### Query Parameters - `xy` (impl Into) - Required - The starting position (x, y) for reading. - `width` (usize) - Required - The number of characters to read from the starting position. ### Request Example ```json { "xy": [5, 5], "width": 10 } ``` ### Response #### Success Response (200) - `line` (string) - A string representing the characters read from the specified line. #### Response Example ```json { "line": "Hello World" } ``` ``` -------------------------------- ### Getting Iterator Subsections with `get` in Rust Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/strings/struct.GridStringIterator_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E The `get` method returns an iterator over a subsection of the original iterator, defined by an `IteratorIndex`. Requires `Self` to be `Sized` and `R` to implement `IteratorIndex`. ```rust /// Returns an iterator over a subsection of the iterator. fn get(self, index: R) -> >::Output where Self: Sized, R: IteratorIndex, ``` -------------------------------- ### General Type Implementations Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/render/struct.UvMappingHandle_search=u32+-%3E+bool Documentation for various general type implementations like Any, Bundle, CloneToUninit, Downcast, and more. ```APIDOC ## General Type Implementations This section details various standard trait implementations available for types within the Bevy ASCII Terminal project. ### `Any` Trait Implementation Allows types to be treated as any type, enabling dynamic type checking and downcasting. - **`type_id(&self) -> TypeId`**: Gets the `TypeId` of the instance. ### `Bundle` and `DynamicBundle` Implementations Facilitates the creation and manipulation of component bundles for entities. - **`Bundle`**: Used for grouping components. - **`component_ids(...)`**: Registers component IDs for a bundle. - **`get_component_ids(...)`**: Retrieves component IDs from a bundle. - **`DynamicBundle`**: Enables dynamic handling of bundles. - **`Effect`**: Defines side effects after bundle insertion. - **`get_components(...)`**: Extracts components from a bundle. - **`apply_effect(...)`**: Applies post-spawning effects. ### `CloneToUninit` Trait Implementation (Nightly Only) Provides experimental functionality for cloning types into uninitialized memory. - **`clone_to_uninit(&self, dest: *mut u8)`**: Performs copy-assignment to a destination pointer. ### `Downcast` and `DowncastSend` Implementations Enables downcasting of trait objects to concrete types. - **`Downcast`**: For general downcasting. - **`into_any(self: Box) -> Box`**: Converts `Box` to `Box`. - **`into_any_rc(self: Rc) -> Rc`**: Converts `Rc` to `Rc`. - **`as_any(&self) -> &(dyn Any + 'static)`**: Gets a reference to the underlying `Any` type. - **`as_any_mut(&mut self) -> &mut (dyn Any + 'static)`**: Gets a mutable reference to the underlying `Any` type. - **`DowncastSend`**: For downcasting `Send` types. - **`into_any_send(self: Box) -> Box`**: Converts `Box` to `Box`. ### `DynEq` Trait Implementation Allows for dynamic equality comparison between trait objects. - **`dyn_eq(&self, other: &(dyn DynEq + 'static)) -> bool`**: Compares `self` with another `DynEq` object for equality. ### `DynamicTypePath` Trait Implementation Provides reflection capabilities for type paths. - **`reflect_type_path(&self) -> &str`**: Returns the full type path. - **`reflect_short_type_path(&self) -> &str`**: Returns a shortened type path. - **`reflect_type_ident(&self) -> Option<&str>`**: Returns the type identifier. - **`reflect_crate_name(&self) -> Option<&str>`**: Returns the crate name. - **`reflect_module_path(&self) -> Option<&str>`**: Returns the module path. ### `DynamicTyped` Trait Implementation Enables reflection of type information. - **`reflect_type_info(&self) -> &'static TypeInfo`**: Returns the compile-time type information. ### `Equivalent` Trait Implementation Allows for comparing a type with a borrowed key. - **`equivalent(&self, key: &K) -> bool`**: Checks if `self` is equivalent to `key`. ### `Borrow`, `BorrowMut` Implementations Standard traits for borrowing and mutable borrowing. - **`borrow(&self) -> &T`**: Immutably borrows from the value. - **`borrow_mut(&mut self) -> &mut T`**: Mutably borrows from the value. ### `AsBindGroupShaderType` Implementation Used for shader type conversions. - **`as_bind_group_shader_type(&self, _images: &RenderAssets) -> U`**: Converts the type to a shader type. ### `Freeze`, `RefUnwindSafe`, `Send`, `Sync`, `Unpin`, `UnwindSafe` Auto-Traits Standard Rust auto-traits indicating thread safety and memory safety properties. Source§ ``` -------------------------------- ### Terminal Initialization and Resizing in Rust Source: https://docs.rs/bevy_ascii_terminal/latest/src/bevy_ascii_terminal/terminal.rs_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Demonstrates how to initialize a new ASCII terminal with a specified size and how to resize it. Resizing reinitializes the tile buffer and updates the terminal's size, ensuring a minimum size of 2x2. ```Rust pub fn new(size: impl GridSize) -> Self { let size = size.to_uvec2().max(UVec2::new(2, 2)); let clear_tile = Tile::default(); let mut terminal = Self { size, clear_tile }; terminal.resize(size); terminal } pub fn resize(&mut self, new_size: impl GridSize) { let new_size = new_size.to_uvec2().max(UVec2::new(2, 2)); self.tiles = vec![self.clear_tile; new_size.tile_count()]; self.size = new_size; } ``` -------------------------------- ### CloneToUninit Trait Implementation (Nightly) Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/transform/struct.SetTerminalGridPosition Documentation for the nightly-only experimental API for the `CloneToUninit` trait. ```APIDOC ## impl CloneToUninit for T where T: Clone, ### Description This is a nightly-only experimental API that provides the `CloneToUninit` trait implementation for any type `T` that implements `Clone`. It allows cloning a value into uninitialized memory. ### Methods #### unsafe fn clone_to_uninit(&self, dest: *mut u8) Performs copy-assignment from `self` to the destination pointer `dest` which points to uninitialized memory. ### Method `clone_to_uninit` ### Endpoint N/A ### Parameters - **dest** (*mut u8) - A raw pointer to the destination memory location. ### Request Body N/A ### Response N/A ### Request Example N/A ### Response Example N/A ``` -------------------------------- ### Example Search Queries for Rust Documentation Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/enum.Pivot_search= Provides example search queries demonstrating how to find specific types, functions, or type transformations within Rust documentation. These examples are useful for navigating large codebases or standard libraries. ```text std::vec ``` ```text u32 -> bool ``` ```text Option, (T -> U) -> Option ``` -------------------------------- ### Rust Terminal Initialization and Resizing Source: https://docs.rs/bevy_ascii_terminal/latest/src/bevy_ascii_terminal/terminal.rs_search=std%3A%3Avec Demonstrates how to initialize a new terminal with a given size and resize it. The resize operation ensures the new size is at least 2x2 and reinitializes the tile buffer. ```Rust /// The local grid bounds of the terminal. For world bounds see [TerminalTransform]. pub fn bounds(&self) -> GridRect { GridRect::new([0, 0], self.size) } pub fn clear_tile(&self) -> Tile { self.clear_tile } pub fn resize(&mut self, new_size: impl GridSize) { let new_size = new_size.to_uvec2().max(UVec2::new(2, 2)); self.tiles = vec![self.clear_tile; new_size.tile_count()]; self.size = new_size; } ``` -------------------------------- ### Get Struct Field in Rust Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/border/struct.BorderString Enables getting a reference to a struct field by its name, with optional downcasting to a specific `Reflect` type. This is crucial for accessing and manipulating struct data dynamically. ```rust impl GetField for S where S: Struct, { fn get_field(&self, name: &str) -> Option<&T> where T: Reflect; fn get_field_mut(&mut self, name: &str) -> Option<&mut T> where T: Reflect; } ``` -------------------------------- ### Get Struct Field by Name Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/tile/struct.Tile_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides methods to safely get references to struct fields by their name. It allows retrieving either an immutable or mutable reference, downcast to a specified `Reflect` type. ```rust fn get_field(&self, name: &str) -> Option<&T> where T: Reflect, S: Struct ``` ```rust fn get_field_mut(&mut self, name: &str) -> Option<&mut T> where T: Reflect, S: Struct ``` -------------------------------- ### Reflection and Settings Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/strings/struct.StringFormatting_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides traits for runtime reflection and configuration settings. ```APIDOC ## Reflection and Settings Traits ### Description Traits for enabling runtime reflection and managing settings. #### `Reflectable` Indicates that a type supports runtime reflection. - **Trait Bounds**: `where T: Reflect + GetTypeRegistration + Typed + TypePath` #### `Settings` Indicates that a type can be used for configuration settings and is thread-safe. - **Trait Bounds**: `where T: 'static + Send + Sync` ### Usage Examples These traits are often implemented on application components or data structures to allow for introspection and configuration. ``` -------------------------------- ### Standard Conversions and Utilities Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/render/struct.RebuildMeshVerts_search= Provides standard conversion traits like `From`, `Into`, `TryFrom`, `TryInto`, and utility methods for instrumentation and conditional operations. ```APIDOC ## `From` and `Into` ### Description These traits enable conversions between types. `From` allows creating a `T` from another type, while `Into` allows converting `self` into type `U`. ### Methods - `from(t: T) -> T` (for `From`) - `into(self) -> U` (for `Into`) ### Endpoint N/A (Methods within trait implementations) ### Parameters - `t: T` (for `from`): The value to convert from. - `self` (for `into`): The value to convert. ### Request Body None ### Request Example ```rust // Using From let value = 5; let string_val = String::from(value.to_string()); // Using Into let number = 10_u32; let float_val: f32 = number.into(); ``` ### Response #### Success Response (200) - `from`: Returns an instance of the target type `T`. - `into`: Returns an instance of the target type `U`. #### Response Example N/A (Return values are direct type conversions. ``` ```APIDOC ## `FromWorld` ### Description Allows types to be constructed from the current `World` state, typically by calling their `default()` method if they implement `Default`. ### Method `from_world(_world: &mut World) -> T` ### Endpoint N/A (Method within a trait implementation) ### Parameters - `_world`: `&mut World` - A mutable reference to the current game world. ### Request Body None ### Request Example ```rust // Assuming MyResource implements FromWorld and Default let my_resource = MyResource::from_world(&mut world); ``` ### Response #### Success Response (200) - `T`: An instance of the type that implements `FromWorld`. #### Response Example N/A (Return value is a constructed type instance. ``` ```APIDOC ## `Instrument` ### Description Provides methods to instrument code execution with tracing spans, allowing for performance monitoring and debugging. ### Methods - `instrument(self, span: Span) -> Instrumented` - `in_current_span(self) -> Instrumented` ### Endpoint N/A (Methods within trait implementations) ### Parameters - `self`: The value to instrument. - `span`: `Span` (for `instrument`): The tracing span to attach. ### Request Body None ### Request Example ```rust use tracing::Span; let my_data = "some data"; let span = Span::current(); // Instrument with a specific span let instrumented_data = my_data.instrument(span.clone()); // Instrument with the current span let instrumented_data_current = my_data.in_current_span(); ``` ### Response #### Success Response (200) - `Instrumented`: A wrapper type that includes the instrumentation context. #### Response Example N/A (Returns a wrapper type. ``` ```APIDOC ## `IntoEither` ### Description Converts a value into either the `Left` or `Right` variant of an `Either` enum based on a boolean condition or a provided closure. ### Methods - `into_either(self, into_left: bool) -> Either` - `into_either_with(self, into_left: F) -> Either` where `F: FnOnce(&Self) -> bool` ### Endpoint N/A (Methods within trait implementations) ### Parameters - `self`: The value to convert. - `into_left`: `bool` (for `into_either`): If `true`, converts to `Left`; otherwise, `Right`. - `into_left`: `F` (for `into_either_with`): A closure that returns `true` to convert to `Left`, `false` for `Right`. ### Request Body None ### Request Example ```rust use std::mem::Either; let value = 10; // Using into_either let either_val_left = value.into_either(true); let either_val_right = value.into_either(false); // Using into_either_with let either_val_conditional = value.into_either_with(|v| *v > 5); ``` ### Response #### Success Response (200) - `Either`: An enum containing either the `Left` or `Right` variant of the original type. #### Response Example ```json { "either_val_left": {"Left": 10} } ``` ``` ```APIDOC ## `IntoResult` ### Description Converts a type into a `Result`, typically used for system return values. ### Method `into_result(self) -> Result` ### Endpoint N/A (Method within a trait implementation) ### Parameters - `self`: The value to convert. ### Request Body None ### Request Example ```rust // Assuming `system_output` is a type that implements IntoResult let result: Result<_, RunSystemError> = system_output.into_result(); ``` ### Response #### Success Response (200) - `Result`: A Result type containing the system's output or an error. #### Response Example ```json { "result": {"Ok": ""} } ``` ``` ```APIDOC ## `Is` Trait ### Description Provides a method to check if a type `is` another type using `TypeId` comparison. Useful for generic type checking. ### Method `is() -> bool` where `T: Any` ### Endpoint N/A (Method within a trait implementation) ### Parameters - Type parameter `T`: The target type to check against. ### Request Body None ### Request Example ```rust // Assuming `my_value` is a trait object or a type that implements Any let is_u32 = my_value.is::(); let is_string = my_value.is::(); ``` ### Response #### Success Response (200) - `bool`: `true` if the type matches `T`, `false` otherwise. #### Response Example ```json { "is_u32": true } ``` ``` ```APIDOC ## `TryFrom` and `TryInto` ### Description These traits enable fallible conversions between types. `TryFrom` attempts to create a `T` from `U`, returning a `Result`, while `TryInto` attempts to convert `self` into `U`. ### Methods - `try_from(value: U) -> Result>::Error>` (for `TryFrom`) - `try_into(self) -> Result>::Error>` (for `TryInto`) ### Endpoint N/A (Methods within trait implementations) ### Parameters - `value: U` (for `try_from`): The value to attempt conversion from. - `self` (for `try_into`): The value to attempt conversion. ### Request Body None ### Request Example ```rust // Using TryFrom let result_from: Result = u32::try_from(100); // Using TryInto let number = 100; let result_into: Result = number.try_into(); ``` ### Response #### Success Response (200) - `Result`: A Result indicating success with the converted type or failure with an error. #### Response Example ```json { "result_from": {"Ok": 100} } ``` ``` ```APIDOC ## `WithSubscriber` ### Description Attaches a `Subscriber` to a type, returning a wrapper that allows operations to be observed or tracked. ### Methods - `with_subscriber(self, subscriber: S) -> WithDispatch` where `S: Into` - `with_current_subscriber(self) -> WithDispatch` ### Endpoint N/A (Methods within trait implementations) ### Parameters - `self`: The value to attach the subscriber to. - `subscriber`: `S` (for `with_subscriber`): The subscriber to attach. ### Request Body None ### Request Example ```rust use tracing::subscriber::Subscriber; use tracing_subscriber::Dispatch; // Assuming `my_type` is a type that implements WithSubscriber let subscriber: Dispatch = ...; // Obtain a Dispatch subscriber let with_dispatch = my_type.with_subscriber(subscriber); let with_current = my_type.with_current_subscriber(); ``` ### Response #### Success Response (200) - `WithDispatch`: A wrapper type containing the original value and the associated dispatch. #### Response Example N/A (Returns a wrapper type. ``` -------------------------------- ### Example: Spawn Terminal with Custom Font Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/render/enum.TerminalFont_search=u32+-%3E+bool This example demonstrates how to spawn an entity with a Terminal component and a Custom TerminalFont, specifying the path to the font image. This allows for using custom image assets as terminal fonts. ```rust use bevy::prelude::*; use bevy_ascii_terminal::*; fn setup(mut commands: Commands) { commands.spawn(( Terminal::new([10,10]), TerminalFont::Custom("assets/MyFont.png".to_string()) )); } ``` -------------------------------- ### Get Terminal Dimensions and Properties in Rust Source: https://docs.rs/bevy_ascii_terminal/latest/src/bevy_ascii_terminal/terminal.rs_search= Provides utility functions to get the width, height, size (UVec2), and total tile count of the terminal. These functions are essential for calculations related to terminal layout and data access. ```rust pub fn width(&self) -> usize { self.size.x as usize } pub fn height(&self) -> usize { self.size.y as usize } pub fn size(&self) -> UVec2 { self.size } pub fn tile_count(&self) -> usize { self.tiles.len() } ``` -------------------------------- ### Initialize Terminal Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/terminal/struct.Terminal_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new `Terminal` instance with the specified grid size. This is the most basic way to initialize a terminal, providing dimensions for the tile grid. ```Rust pub struct Terminal { /* private fields */ } ``` -------------------------------- ### Get Path and Reflect Path (Rust) Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/render/struct.UvMappingHandle_search=u32+-%3E+bool These functions allow getting references (mutable or immutable) to values within a reflected structure using a specified path. They return a `Result` which may contain an error if the path is invalid. ```rust impl GetPath for T where T: Reflect + ?Sized, fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>> ``` ```rust fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>> ``` ```rust fn path<'p, T>( &self, path: impl ReflectPath<'p>, ) -> Result<&T, ReflectPathError<'p>> where T: Reflect, ``` ```rust fn path_mut<'p, T>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut T, ReflectPathError<'p>> where T: Reflect, ``` -------------------------------- ### From Trait Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/render/struct.UvMappingHandle_search= Documentation for the `From` trait, which enables conversions into a type. ```APIDOC ## From Trait ### Description Allows creating an instance of a type from another type. ### Method `from` ### Endpoint N/A (Trait implementation) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```rust // Example usage for converting a value using From let value: OtherType = ...; let new_instance: T = T::from(value); ``` ### Response #### Success Response (T) - An instance of type `T` created from the input value. #### Response Example ```json // Resulting value of type T ``` ``` -------------------------------- ### IntoSystemSet Trait Methods Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/render/struct.TerminalSystemsUpdateFont_search= Documentation for methods related to the IntoSystemSet trait, used for converting into a SystemSet. ```APIDOC ## fn into_system_set(self) -> >::Set ### Description Converts this instance to its associated `SystemSet` type. ### Method `into_system_set` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "Not applicable for this method." } ``` ### Response #### Success Response (200) - **>::Set**: The converted `SystemSet`. #### Response Example ```json { "example": "SystemSet object" } ``` ``` -------------------------------- ### Get Struct Field by Name (Rust) Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/strings/struct.StringFormatting Provides methods to get references to struct fields by their name. `get_field` returns an immutable reference, while `get_field_mut` returns a mutable reference. Both attempt to downcast the field value to the specified type `T`. ```rust fn get_field(&self, name: &str) -> Option<&T> ``` ```rust fn get_field_mut(&mut self, name: &str) -> Option<&mut T> ``` -------------------------------- ### Rust: Reflect and Get Path for Data Access Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/render/struct.UvMappingHandle_search=std%3A%3Avec The `GetPath` trait enables accessing data within a structure using a path. It provides methods to get immutable or mutable references to values specified by the path, including statically typed access. ```rust impl GetPath for T where T: Reflect + ?Sized, { fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>; fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>; fn path<'p, T>( &self, path: impl ReflectPath<'p>, ) -> Result<&T, ReflectPathError<'p>> where T: Reflect; fn path_mut<'p, T>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut T, ReflectPathError<'p>> where T: Reflect; } ``` -------------------------------- ### Rust: Initialize TerminalPlugins in Bevy App Source: https://docs.rs/bevy_ascii_terminal/latest/src/bevy_ascii_terminal/lib.rs Demonstrates how to add the TerminalPlugins to a Bevy application. This includes inserting default resources and adding various sub-plugins for terminal transformation, UV mapping, material, font, camera, and mesh rendering. It also configures system update order. ```Rust pub struct TerminalPlugins; impl Plugin for TerminalPlugins { fn build(&self, app: &mut bevy::prelude::App) { app.insert_resource(TerminalMeshWorldScaling::default()); app.add_plugins(( transform::TerminalTransformPlugin, // 'PostUpdate' systems render::TerminalUvMappingPlugin, render::TerminalMaterialPlugin, render::TerminalFontPlugin, // 'PostUpdate' systems render::TerminalCameraPlugin, // 'First` systems render::TerminalMeshPlugin, // 'PostUpdate' systems )); app.configure_sets( PostUpdate, TerminalSystemsUpdateTransform.before(render::TerminalSystemsUpdateMesh), ); } } ``` -------------------------------- ### IntoScheduleConfigs Methods Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/render/struct.TerminalSystemsUpdateCamera_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides methods for configuring schedules from system sets. ```APIDOC ## into_configs ### Description Convert into a `ScheduleConfigs`. ### Method `into_configs` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "Not applicable" } ``` ### Response #### Success Response (200) - **ScheduleConfigs>**: The schedule configurations. #### Response Example ```json { "example": "schedule_configs" } ``` ``` ```APIDOC ## in_set ### Description Add these systems to the provided `set`. ### Method `in_set` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "Not applicable" } ``` ### Response #### Success Response (200) - **ScheduleConfigs**: The updated schedule configurations. #### Response Example ```json { "example": "updated_schedule_configs" } ``` ``` ```APIDOC ## before ### Description Runs before all systems in `set`. If `self` has any systems that produce `Commands` or other `Deferred` operations, all systems in `set` will see their effect. ### Method `before` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "Not applicable" } ``` ### Response #### Success Response (200) - **ScheduleConfigs**: The updated schedule configurations with ordering dependency. #### Response Example ```json { "example": "updated_schedule_configs" } ``` ``` ```APIDOC ## after ### Description Runs after all systems in `set`. If `set` has any systems that produce `Commands` or other `Deferred` operations, all systems in `self` will see their effect. ### Method `after` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "Not applicable" } ``` ### Response #### Success Response (200) - **ScheduleConfigs**: The updated schedule configurations with ordering dependency. #### Response Example ```json { "example": "updated_schedule_configs" } ``` ``` ```APIDOC ## before_ignore_deferred ### Description Runs before all systems in `set`. ### Method `before_ignore_deferred` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "Not applicable" } ``` ### Response #### Success Response (200) - **ScheduleConfigs**: The updated schedule configurations with ordering dependency, ignoring deferred operations. #### Response Example ```json { "example": "updated_schedule_configs" } ``` ``` ```APIDOC ## after_ignore_deferred ### Description Runs after all systems in `set`. ### Method `after_ignore_deferred` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "Not applicable" } ``` ### Response #### Success Response (200) - **ScheduleConfigs**: The updated schedule configurations with ordering dependency, ignoring deferred operations. #### Response Example ```json { "example": "updated_schedule_configs" } ``` ``` ```APIDOC ## distributive_run_if ### Description Add a run condition to each contained system. ### Method `distributive_run_if` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "Not applicable" } ``` ### Response #### Success Response (200) - **ScheduleConfigs**: The updated schedule configurations with a distributive run condition. #### Response Example ```json { "example": "updated_schedule_configs" } ``` ``` ```APIDOC ## run_if ### Description Run the systems only if the `SystemCondition` is `true`. ### Method `run_if` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "Not applicable" } ``` ### Response #### Success Response (200) - **ScheduleConfigs**: The updated schedule configurations with a run condition. #### Response Example ```json { "example": "updated_schedule_configs" } ``` ``` ```APIDOC ## ambiguous_with ### Description Suppress warnings and errors that would result from these systems having ambiguities (conflicting access but indeterminate order) with systems in `set`. ### Method `ambiguous_with` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "Not applicable" } ``` ### Response #### Success Response (200) - **ScheduleConfigs**: The updated schedule configurations with ambiguity suppressed for the specified set. #### Response Example ```json { "example": "updated_schedule_configs" } ``` ``` ```APIDOC ## ambiguous_with_all ### Description Suppress warnings and errors that would result from these systems having ambiguities (conflicting access but indeterminate order) with any other system. ### Method `ambiguous_with_all` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "Not applicable" } ``` ### Response #### Success Response (200) - **ScheduleConfigs**: The updated schedule configurations with ambiguity suppressed for all other systems. #### Response Example ```json { "example": "updated_schedule_configs" } ``` ``` ```APIDOC ## chain ### Description Treat this collection as a sequence of systems. ### Method `chain` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "Not applicable" } ``` ### Response #### Success Response (200) - **ScheduleConfigs**: The schedule configurations representing a chained sequence of systems. #### Response Example ```json { "example": "chained_schedule_configs" } ``` ``` ```APIDOC ## chain_ignore_deferred ### Description Treat this collection as a sequence of systems, ignoring deferred operations. ### Method `chain_ignore_deferred` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "Not applicable" } ``` ### Response #### Success Response (200) - **ScheduleConfigs**: The schedule configurations representing a chained sequence of systems, ignoring deferred operations. #### Response Example ```json { "example": "chained_schedule_configs" } ``` ``` -------------------------------- ### Implement PartialReflect for SetTerminalGridPosition in Rust Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/transform/struct.SetTerminalGridPosition_search=std%3A%3Avec Implements the PartialReflect trait for SetTerminalGridPosition, allowing for partial reflection of the struct's type information. This includes methods to get type info, try to apply values, determine reflect kind, and get a reflection reference. ```rust impl PartialReflect for SetTerminalGridPosition { fn get_represented_type_info(&self) -> Option<&'static TypeInfo>; fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError>; fn reflect_kind(&self) -> ReflectKind; fn reflect_ref(&self) -> ReflectRef<'_>; } ``` -------------------------------- ### From Trait Methods Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/render/struct.TerminalSystemsUpdateFont_search= Documentation for the `from` method within the `From` for `T` implementation. ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. ### Method `from` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "Not applicable for this method." } ``` ### Response #### Success Response (200) - **T**: The input value `t` unchanged. #### Response Example ```json { "example": "Input value T" } ``` ``` -------------------------------- ### Example: Spawning Terminal with Custom Font in Rust Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/render/enum.TerminalFont_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Demonstrates how to spawn an entity with a Terminal component and a custom font. This example uses `TerminalFont::Custom` to load a font from a specified image file path. Ensure the image asset is correctly placed and loaded by Bevy. ```rust use bevy::prelude::*; use bevy_ascii_terminal::*; fn setup(mut commands: Commands) { commands.spawn(( Terminal::new([10,10]), TerminalFont::Custom("assets/MyFont.png".to_string()) )); } ``` -------------------------------- ### Settings Implementation Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/border/struct.BorderString_search= Documentation for the `Settings` trait implementation for generic types `T` that are `'static`, `Send`, and `Sync`. ```APIDOC ## impl Settings for T ### Description This section covers the implementation of the `Settings` trait for a generic type `T`. The constraints for this implementation are that `T` must be `'static`, `Send`, and `Sync`. ### Method N/A (Trait Implementation) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### Slice Access API Source: https://docs.rs/bevy_ascii_terminal/latest/src/bevy_ascii_terminal/terminal.rs_search=u32+-%3E+bool Provides methods to get slices of all terminal tiles. ```APIDOC ## GET /tiles/slice ### Description Returns a slice containing all tiles in the terminal. ### Method GET ### Endpoint `/tiles/slice` ### Response #### Success Response (200) - **tiles** (Array) - A slice of all tiles. #### Response Example ```json { "example": "Slice of Tile objects" } ``` ## GET /tiles/slice_mut ### Description Returns a mutable slice containing all tiles in the terminal. ### Method GET ### Endpoint `/tiles/slice_mut` ### Response #### Success Response (200) - **tiles** (Array) - A mutable slice of all tiles. #### Response Example ```json { "example": "Mutable slice of Tile objects" } ``` ``` -------------------------------- ### BundleFromComponents Trait Implementation Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/transform/struct.SetTerminalGridPosition Documentation for the blanket implementation of `BundleFromComponents` for any component `C`. ```APIDOC ## impl BundleFromComponents for C where C: Component, ### Description This is a blanket implementation of the `BundleFromComponents` trait for any type `C` that implements the `Component` trait. This trait allows creating a bundle from a set of components provided through a context. ### Methods #### unsafe fn from_components(ctx: &mut T, func: &mut F) -> C where F: for<'a> FnMut(&'a mut T) -> OwningPtr<'a>, This unsafe method creates an instance of the bundle `C` by extracting components from the provided context `T` using the function `func`. ### Method `from_components` ### Endpoint N/A ### Parameters - **ctx** (&mut T) - A mutable reference to the context containing components. - **func** (&mut F) - A mutable reference to a function that extracts components from the context. ### Request Body N/A ### Response - **C** (C) - An instance of the bundle. ### Request Example N/A ### Response Example ```json { "bundle_instance": "..." } ``` ``` -------------------------------- ### GetField Trait Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/terminal/struct.Terminal_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides methods to get struct fields by name. ```APIDOC ## GetField Trait ### Description Provides methods to access struct fields by name, either immutably or mutably, and downcast them to a specific reflected type. ### Method `get_field(&self, name: &str) -> Option<&T>` `get_field_mut(&mut self, name: &str) -> Option<&mut T>` ### Endpoint N/A (Methods within a trait) ### Parameters - `name` (str) - The name of the field to retrieve. - `T` (Reflect) - The type to downcast the field to. ### Request Example None ### Response #### Success Response - `Option<&T>`: An optional reference to the field value if found and downcastable. - `Option<&mut T>`: An optional mutable reference to the field value if found and downcastable. ### Response Example None ``` -------------------------------- ### Get Terminal Height Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/terminal/struct.Terminal_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Returns the height of the terminal grid in tiles. ```Rust pub fn height(&self) -> usize ``` -------------------------------- ### Configure System Set Order and Conditions Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/render/struct.TerminalSystemsUpdateCamera_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E This extensive set of methods allows fine-grained control over how systems are scheduled within Bevy. It includes configuring execution order (`before`, `after`), run conditions (`run_if`), handling ambiguities (`ambiguous_with`), and chaining systems. ```rust /// Convert into a `ScheduleConfigs`. fn into_configs(self) -> ScheduleConfigs> ``` ```rust /// Add these systems to the provided `set`. fn in_set(self, set: impl SystemSet) -> ScheduleConfigs ``` ```rust /// Runs before all systems in `set`. /// If `self` has any systems that produce `Commands` or other `Deferred` operations, /// all systems in `set` will see their effect. fn before(self, set: impl IntoSystemSet) -> ScheduleConfigs ``` ```rust /// Run after all systems in `set`. /// If `set` has any systems that produce `Commands` or other `Deferred` operations, /// all systems in `self` will see their effect. fn after(self, set: impl IntoSystemSet) -> ScheduleConfigs ``` ```rust /// Run before all systems in `set`. fn before_ignore_deferred( self, set: impl IntoSystemSet, ) -> ScheduleConfigs ``` ```rust /// Run after all systems in `set`. fn after_ignore_deferred( self, set: impl IntoSystemSet, ) -> ScheduleConfigs ``` ```rust /// Add a run condition to each contained system. fn distributive_run_if( self, condition: impl SystemCondition + Clone, ) -> ScheduleConfigs ``` ```rust /// Run the systems only if the `SystemCondition` is `true`. fn run_if(self, condition: impl SystemCondition) -> ScheduleConfigs ``` ```rust /// Suppress warnings and errors that would result from these systems having ambiguities /// (conflicting access but indeterminate order) with systems in `set`. fn ambiguous_with(self, set: impl IntoSystemSet) -> ScheduleConfigs ``` ```rust /// Suppress warnings and errors that would result from these systems having ambiguities /// (conflicting access but indeterminate order) with any other system. fn ambiguous_with_all(self) -> ScheduleConfigs ``` ```rust /// Treat this collection as a sequence of systems. fn chain(self) -> ScheduleConfigs ``` ```rust /// Treat this collection as a sequence of systems. fn chain_ignore_deferred(self) -> ScheduleConfigs ``` -------------------------------- ### Terminal Initialization from REXPaint Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/terminal/struct.Terminal_search=u32+-%3E+bool Explains how to create a terminal directly from a REXPaint file. Note that layering information from REXPaint is not preserved. ```Rust use bevy_ascii_terminal::Terminal; // Attempt to create a terminal from a REXPaint file // This will write all layers to the same terminal grid. let terminal = Terminal::from_rexpaint_file("path/to/your/rexpaint_file.xp").unwrap(); ``` -------------------------------- ### Get Terminal Width Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/terminal/struct.Terminal_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Returns the width of the terminal grid in tiles. ```Rust pub fn width(&self) -> usize ``` -------------------------------- ### TerminalBorder Glyph Accessors Source: https://docs.rs/bevy_ascii_terminal/latest/bevy_ascii_terminal/border/struct.TerminalBorder_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Methods to get specific glyphs from the TerminalBorder. ```APIDOC ## TerminalBorder::top_left_glyph ### Description Gets the glyph for the top-left corner. ### Method `pub fn top_left_glyph(&self) -> Option` ``` ```APIDOC ## TerminalBorder::top_glyph ### Description Gets the glyph for the top edge. ### Method `pub fn top_glyph(&self) -> Option` ``` ```APIDOC ## TerminalBorder::top_right_glyph ### Description Gets the glyph for the top-right corner. ### Method `pub fn top_right_glyph(&self) -> Option` ``` ```APIDOC ## TerminalBorder::left_glyph ### Description Gets the glyph for the left edge. ### Method `pub fn left_glyph(&self) -> Option` ``` ```APIDOC ## TerminalBorder::right_glyph ### Description Gets the glyph for the right edge. ### Method `pub fn right_glyph(&self) -> Option` ``` ```APIDOC ## TerminalBorder::bottom_left_glyph ### Description Gets the glyph for the bottom-left corner. ### Method `pub fn bottom_left_glyph(&self) -> Option` ``` ```APIDOC ## TerminalBorder::bottom_glyph ### Description Gets the glyph for the bottom edge. ### Method `pub fn bottom_glyph(&self) -> Option` ``` ```APIDOC ## TerminalBorder::bottom_right_glyph ### Description Gets the glyph for the bottom-right corner. ### Method `pub fn bottom_right_glyph(&self) -> Option` ```