### Settings Search Examples Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinDash_search= Provides examples of how to perform searches within the settings. ```APIDOC ## Settings Search Examples ### Description This section provides example search queries for the settings functionality. ### Method GET ### Endpoint /settings/search ### Parameters #### Query Parameters - **query** (string) - Required - The search query string. ### Request Example ``` GET /settings/search?query=std::vec ``` ### Response #### Success Response (200) - **results** (array) - A list of search results. #### Response Example ```json { "results": [ "std::vec::Vec", "std::vec::VecDeque" ] } ``` ``` -------------------------------- ### Settings Type Conversion Examples Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinDash_search= Illustrates examples of type conversions within settings, such as u32 to bool. ```APIDOC ## Settings Type Conversion Examples ### Description This section provides examples of type conversions relevant to settings, such as converting a `u32` to a `bool`. ### Method GET ### Endpoint /settings/convert ### Parameters #### Query Parameters - **from_type** (string) - Required - The type to convert from (e.g., "u32"). - **to_type** (string) - Required - The type to convert to (e.g., "bool"). - **value** (string) - Required - The value to convert. ### Request Example ``` GET /settings/convert?from_type=u32&to_type=bool&value=1 ``` ### Response #### Success Response (200) - **converted_value** (string) - The converted value. #### Response Example ```json { "converted_value": "true" } ``` ``` -------------------------------- ### Settings Option Transformation Examples Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinDash_search= Demonstrates examples of Option type transformations, like (T -> U) -> Option. ```APIDOC ## Settings Option Transformation Examples ### Description This section provides examples of transformations involving `Option` types, such as mapping a function `T -> U` over an `Option` to produce an `Option`. ### Method POST ### Endpoint /settings/option/transform ### Parameters #### Request Body - **input_option** (object | null) - Required - The input Option, represented as an object or null. - **transformation_function** (string) - Required - A string representation of the transformation function (e.g., "T -> U"). ### Request Example ```json { "input_option": { "value": 5 }, "transformation_function": "x -> x * 2" } ``` ### Response #### Success Response (200) - **transformed_option** (object | null) - The transformed Option, represented as an object or null. #### Response Example ```json { "transformed_option": { "value": 10 } } ``` ``` -------------------------------- ### Settings Implementation Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/struct.TnuaRigidBodyTracker_search= This section details the implementation of settings for generic types and provides example searches. ```APIDOC ## Settings for T ### Description This section describes the implementation of settings for generic types `T` where `T` must be `'static + Send + Sync`. It also includes example searches for various scenarios. ### Method N/A (Implementation Detail) ### Endpoint N/A (Implementation Detail) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ### Example Searches - `std::vec` - `u32 -> bool` - `Option, (T -> U) -> Option` ``` -------------------------------- ### Check if Action Just Started Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/enum.TnuaActionLifecycleStatus A boolean function that returns true if the action has just begun, either from a neutral state or by replacing a previous action. This helps in triggering initial setup logic. ```rust pub fn just_started(&self) -> bool ``` -------------------------------- ### Settings Implementations Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinKnockback_search=u32+-%3E+bool Documentation for the `Settings` trait. ```APIDOC ## impl Settings for T ### Description A trait for types that can be used as settings. ``` -------------------------------- ### Implement Default for TnuaBuiltinKnockbackConfig in Rust Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinKnockbackConfig_search=std%3A%3Avec Enables the creation of a TnuaBuiltinKnockbackConfig instance with default values. This is useful for initializing the knockback configuration when a specific setup is not immediately provided, ensuring a sensible starting point. ```rust impl Default for TnuaBuiltinKnockbackConfig Source§ #### fn default() -> Self Returns the “default value” for a type. Read more ``` -------------------------------- ### TryFrom and TryInto Implementations Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinWalk_search=u32+-%3E+bool Provides fallible type conversions. ```APIDOC ## impl TryFrom for T ### Description Provides fallible conversion from type `U` into type `T`. ### Associated Type and Method #### `type Error = Infallible` The type returned in the event of a conversion error. #### `fn try_from(value: U) -> Result>::Error>` Performs the conversion. ## impl TryInto for T ### Description Provides fallible conversion from type `T` into type `U`. ### Associated Type and Method #### `type Error = >::Error` The type returned in the event of a conversion error. #### `fn try_into(self) -> Result>::Error>` Performs the conversion. ``` -------------------------------- ### Implement Default Trait for TnuaMotor in Rust Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/struct.TnuaMotor_search=u32+-%3E+bool Enables the creation of a default `TnuaMotor` instance, useful for initializing components with zero velocity change. This simplifies setup and ensures a predictable starting state. ```rust impl Default for TnuaMotor { fn default() -> TnuaMotor { // Returns the “default value” for a type. TnuaMotor { lin: Default::default(), ang: Default::default() } } } ``` -------------------------------- ### TnuaActionFlowStatus Just Started Action Check Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/controller/enum.TnuaActionFlowStatus A method to check if an action has just started in the current frame. It returns `Some(D)` if a new action has commenced, and `None` if no action is present or the ongoing action started in a previous frame. ```rust pub fn just_starting(&self) -> Option ``` -------------------------------- ### Settings Implementation Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/control_helpers/struct.TnuaSimpleFallThroughPlatformsHelper_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Documentation for the `Settings` trait implementation. ```APIDOC ## `impl Settings for T` ### Description This block details the implementation of the `Settings` trait for generic type `T`, with the constraints that `T` must be `'static`, `Send`, and `Sync`. ``` -------------------------------- ### Example Searches for Rust Types Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinClimb_search= Provides example search queries for exploring Rust types and their functionalities within the project. These examples cover standard library types, type conversions, and generic type manipulation. ```rust * std::vec * u32 -> bool * Option, (T -> U) -> Option ``` -------------------------------- ### From and Into Implementations Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinWalk_search=u32+-%3E+bool Facilitates type conversions between compatible types. ```APIDOC ## impl From for T ### Description Provides a conversion from a type to itself. ### Method #### `fn from(t: T) -> T` Returns the argument unchanged. ## impl Into for T ### Description Provides a conversion from type `T` into type `U`. ### Method #### `fn into(self) -> U` Calls `U::from(self)`. ``` -------------------------------- ### Get Reference to Any from Trait Object Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinWalkSensorsGhostOverwrites Provides methods to obtain references to `dyn Any` from trait objects. `as_any` gets an immutable reference (`&dyn Any`), while `as_any_mut` gets a mutable reference (`&mut dyn Any`). These are crucial when Rust cannot automatically generate the necessary vtables. ```rust /// Converts `&Trait` (where `Trait: Downcast`) to `&Any`. /// This is needed since Rust cannot generate `&Any`’s vtable from `&Trait`’s. fn as_any(&self) -> &(dyn Any + 'static) /// Converts `&mut Trait` (where `Trait: Downcast`) to `&Any`. /// This is needed since Rust cannot generate `&mut Any`’s vtable from `&mut Trait`’s. fn as_any_mut(&mut self) -> &mut (dyn Any + 'static) ``` -------------------------------- ### From and Into Implementations Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinWalkConfig Covers blanket implementations for `From for T` and `Into for T`. ```APIDOC ## Blanket Implementations for From and Into ### impl From for T Allows a type to be converted from itself. #### fn from(t: T) -> T Returns the argument unchanged. ### impl Into for T where U: From, Allows conversion from type `T` to type `U` if `U` implements `From`. #### fn into(self) -> U Calls `U::from(self)`. ``` -------------------------------- ### CloneToUninit Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinKnockback_search= Provides functionality for cloning data into uninitialized memory. This is an experimental, nightly-only API. ```APIDOC ## unsafe fn clone_to_uninit(&self, dest: *mut u8) ### Description Performs copy-assignment from `self` to `dest`. ### Method `unsafe fn` ### Endpoint N/A (Method implementation) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A (This is a method, not an API endpoint) #### Response Example N/A ``` -------------------------------- ### Example Searches for Rust Types and Functions Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/data_for_backends/struct.TnuaGhostSensor_search= Provides example search queries demonstrating how to find specific types, function signatures, and generic type transformations within the project's documentation or codebase. These examples cover standard library types and common functional patterns. ```text std::vec u32 -> bool Option, (T -> U) -> Option ``` -------------------------------- ### TnuaActionState Implementations (Examples) Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/trait.TnuaActionState_search=u32+-%3E+bool Examples of how the TnuaActionState trait is used with specific methods and types, particularly concerning action equivalency and discriminant checks. ```APIDOC ## TnuaActionState Implementations ### `bevy_tnua::control_helpers::TnuaAirActionDefinition::is_air_action` - **Method**: Trait method - **Signature**: `bevy_tnua::control_helpers::TnuaAirActionDefinition::is_air_action` - **Returns**: `bool` - **Description**: Checks if the action is an air action. This method is associated with `TnuaScheme::ActionDiscriminant` where `u32` matches `TnuaScheme::ActionDiscriminant`. ### `bevy_tnua::TnuaToggle::equivalent` - **Method**: Trait method - **Signature**: `bevy_tnua::TnuaToggle::equivalent` - **Returns**: `bool` - **Description**: Checks for equivalency between two toggle states. This method is associated with types `K` where `u32` matches `K`. ### `bevy_tnua::TnuaSystems::equivalent` - **Method**: Trait method - **Signature**: `bevy_tnua::TnuaSystems::equivalent` - **Returns**: `bool` - **Description**: Checks for equivalency between two system states. This method is associated with types `K` where `u32` matches `K`. ### `bevy_tnua::TnuaPipelineSystems::equivalent` - **Method**: Trait method - **Signature**: `bevy_tnua::TnuaPipelineSystems::equivalent` - **Returns**: `bool` - **Description**: Checks for equivalency between two pipeline system states. This method is associated with types `K` where `u32` matches `K`. ### `bevy_tnua::TnuaActionLifecycleStatus::equivalent` - **Method**: Trait method - **Signature**: `bevy_tnua::TnuaActionLifecycleStatus::equivalent` - **Returns**: `bool` - **Description**: Checks for equivalency between two action lifecycle status states. This method is associated with types `K` where `u32` matches `K`. ### `bevy_tnua::TnuaActionInitiationDirective::equivalent` - **Method**: Trait method - **Signature**: `bevy_tnua::TnuaActionInitiationDirective::equivalent` - **Returns**: `bool` - **Description**: Checks for equivalency between two action initiation directive states. This method is associated with types `K` where `u32` matches `K`. ### `bevy_tnua::TnuaUserControlsSystems::equivalent` - **Method**: Trait method - **Signature**: `bevy_tnua::TnuaUserControlsSystems::equivalent` - **Returns**: `bool` - **Description**: Checks for equivalency between two user control system states. This method is associated with types `K` where `u32` matches `K`. ``` -------------------------------- ### Settings API Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinKnockback Applies settings to types that are static, sendable, and synchronizable. ```APIDOC ## Settings Trait ### Description Provides a trait for applying settings to types that meet specific criteria: `'static`, `Send`, and `Sync`. ### Method N/A (Trait implementation) ### Endpoint N/A ### Parameters None ### Request Example N/A ### Response N/A ### Response Example N/A ``` -------------------------------- ### TryFrom and TryInto Conversions Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinClimbConfig_search= Methods for attempting conversions that may fail. ```APIDOC ## `try_from` ### Description Performs the conversion from `U` to `T`, returning a `Result`. ### Method `fn try_from(value: U) -> Result>::Error>` where U: Into ### Endpoint N/A (Method within a type implementation) ### Parameters - `value` (U): The value to convert. ### Request Body None ### Response #### Success Response `Result`: Ok(T) if conversion succeeds, Err(Error) otherwise. ### Response Example N/A ## `try_into` ### Description Performs the conversion from `T` to `U`, returning a `Result`. ### Method `fn try_into(self) -> Result>::Error>` where U: TryFrom ### Endpoint N/A (Method within a type implementation) ### Parameters None ### Request Body None ### Response #### Success Response `Result`: Ok(U) if conversion succeeds, Err(Error) otherwise. ### Response Example N/A ``` -------------------------------- ### TnuaActionSlots Method: get Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/control_helpers/trait.TnuaActionSlots_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E The get method for the TnuaActionSlots trait. It retrieves the current value of the counter for a specific action's slot. Returns None if the action is not assigned to any slot. ```rust fn get( &self, action: ::ActionDiscriminant, ) -> Option; ``` -------------------------------- ### Start Action (Push Fashion) - Rust Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/controller/struct.TnuaController The `action_start` method triggers an action in a push fashion, allowing it to continue until `action_end` is called or the motion naturally finishes. This is suitable for actions with a defined start and end, or those that persist until explicitly stopped. ```rust pub fn action_start(&mut self, action: S) ``` -------------------------------- ### CloneToUninit Implementation Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinWalkConfig Documentation for the nightly-only experimental `CloneToUninit` trait implementation. ```APIDOC ## Nightly-Only Experimental API: CloneToUninit ### impl CloneToUninit for T where T: Clone, This is a nightly-only experimental API. #### unsafe fn clone_to_uninit(&self, dest: *mut u8) Performs copy-assignment from `self` to `dest`. ``` -------------------------------- ### FromWorld Implementation Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinWalk_search=u32+-%3E+bool Allows creating instances of a type from the game world. ```APIDOC ## impl FromWorld for T ### Description Allows creating instances of a type from the game world. ### Method #### `fn from_world(_world: &mut World) -> T` Creates `Self` using `default()`. ``` -------------------------------- ### TnuaScheme Example with Control Scheme Enum Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/derive.TnuaScheme_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E An example demonstrating the usage of the `#[derive(TnuaScheme)]` macro with a control scheme enum named `ControlScheme`. It showcases how to define actions, their associated payloads, and how to use `#[scheme(modify_basis_config)]` to alter the basis configuration. ```Rust #[derive(TnuaScheme)] #[scheme(basis = TnuaBuiltinWalk)] pub enum ControlScheme { Jump(TnuaBuiltinJump), Crouch( TnuaBuiltinCrouch, // While this action is in effect, `SlowDownWhileCrouching` will change the // `TnuaBuiltinWalkConfig` to reduce character speed. #[scheme(modify_basis_config)] SlowDownWhileCrouching, ), WallSlide( TnuaBuiltinWallSlide, // This payload has is ignored by Tnua, but user code can use it to tell which wall // the character is sliding on. Entity, ), } ``` -------------------------------- ### Example Usage of TnuaActionsCounter::count_for (Rust) Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/control_helpers/struct.TnuaActionsCounter_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E This example demonstrates how to use `count_for` to limit air jumps. It checks if the number of air jumps (obtained via `count_for`) is less than or equal to 1, allowing for one air jump per count. ```rust let air_actions: TnuaActionsCounter; // actually get this from a Query controller.action(ControlScheme::Jump(TnuaBuiltinJump { allow_in_air: air_actions.count_for(ControlSchemeActionDiscriminant::Jump) // Allow one air jump - use <= instead of < because the first one in the air will // be have its `count_for` return 1. <= 1, ..Default::default() })); ``` -------------------------------- ### Re-export TnuaScheme, TnuaBuiltinJump, TnuaBuiltinWalk, TnuaConfig, TnuaController, TnuaControllerPlugin, TnuaUserControlsSystems Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/prelude/index_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E This snippet shows the re-exports from the bevy-tnua crate's prelude module. These are essential components for defining and managing character controller schemes and their associated systems. ```rust pub use crate::TnuaScheme; pub use crate::builtins::TnuaBuiltinJump; pub use crate::builtins::TnuaBuiltinWalk; pub use crate::TnuaConfig; pub use crate::TnuaController; pub use crate::TnuaControllerPlugin; pub use crate::TnuaUserControlsSystems; ``` -------------------------------- ### TryFrom Implementation Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinWalkConfig Documentation for the `TryFrom` trait implementation. ```APIDOC ## Blanket Implementation for TryFrom ### impl TryFrom for T where U: Into, Allows attempting to convert from type `U` to type `T` if `U` implements `Into`. ``` -------------------------------- ### DVec2 Type Registration Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/math/type.Vector2_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Methods for getting and registering type information for DVec2. ```APIDOC ## DVec2 Type Registration This section covers methods related to the type registration of `DVec2`. ### `impl GetTypeRegistration for DVec2` #### `fn get_type_registration() -> TypeRegistration` Returns the default `TypeRegistration` for this type. #### `fn register_type_dependencies(registry: &mut TypeRegistry)` Registers other types needed by this type. ``` -------------------------------- ### Bundle Creation from Components Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/control_helpers/struct.TnuaSimpleFallThroughPlatformsHelper_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Allows for the creation of a bundle from a provided context and a function that extracts components. ```APIDOC ## POST /bundles/from_components ### Description Creates a bundle of type `C` by executing a provided function `func` within a given context `ctx`. The function `func` is responsible for extracting the necessary components. ### Method POST ### Endpoint /bundles/from_components ### Parameters #### Request Body - **ctx** (T) - Required - The context in which to create the bundle. - **func** (F) - Required - A function that takes a mutable reference to `T` and returns an `OwningPtr` to the components. ### Request Example ```json { "ctx": { ... }, "func": "" } ``` ### Response #### Success Response (200) - **bundle** (C) - The created bundle of type `C`. #### Response Example ```json { "bundle": { ... } } ``` ``` -------------------------------- ### TnuaActionInitiationDirective Enum Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/enum.TnuaActionInitiationDirective_search= Represents a decision by TnuaAction::initiation_decision that determines if an action can start. ```APIDOC ## Enum TnuaActionInitiationDirective ### Description A decision by `TnuaAction::initiation_decision` that determines if the action can start. ### Variants * **Reject**: The action will not start as long as the input is still fed. In order to start it, the input must be released for at least one frame and then start being fed again. * **Delay**: The action will not start this frame, but if the input is still fed next frame `TnuaAction::initiation_decision` will be checked again. * **Allow**: The action can start this frame. ### Source Code ```rust pub enum TnuaActionInitiationDirective { Reject, Delay, Allow, } ``` ``` -------------------------------- ### TryFrom and TryInto Conversions Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/control_helpers/struct.TnuaSimpleFallThroughPlatformsHelper_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides fallible conversion between types, returning a `Result`. ```APIDOC ## Fallible Type Conversions (TryFrom/TryInto) ### Description These traits enable fallible conversions between types. `TryFrom` attempts to convert a source type `U` into a target type `T`, while `TryInto` performs the conversion in the reverse direction. Both return a `Result` indicating success or failure. ### `TryFrom` Trait #### Associated Types ##### `type Error = Infallible` The type returned when a conversion fails. `Infallible` indicates that this specific conversion is guaranteed to succeed if the `Into` trait is implemented. #### Methods ##### `try_from(value: U) -> Result>::Error>` Attempts to perform the conversion from `value` (of type `U`) into the target type `T`. Returns `Ok(T)` on success or `Err(Error)` on failure. ### `TryInto` Trait #### Associated Types ##### `type Error = >::Error` The error type is the same as the `Error` type for the corresponding `TryFrom` implementation. #### Methods ##### `try_into(self) -> Result>::Error>` Attempts to perform the conversion of `self` (of type `T`) into the target type `U`. Returns `Ok(U)` on success or `Err(Error)` on failure. ``` -------------------------------- ### Module prelude Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/prelude/index_search=u32+-%3E+bool This section re-exports key types and traits from the bevy_tnua crate, providing convenient access to essential components for character control. ```APIDOC ## Module prelude ### Description Re-exports key components from the `bevy_tnua` crate for easy access. ### Re-exports - `crate::TnuaScheme` - `crate::builtins::TnuaBuiltinJump` - `crate::builtins::TnuaBuiltinWalk` - `crate::TnuaConfig` - `crate::TnuaController` - `crate::TnuaControllerPlugin` - `crate::TnuaUserControlsSystems` ``` -------------------------------- ### Reference to &dyn Any Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/struct.TnuaGhostSensor_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides methods to get a reference to `&dyn Any` from a reference to a trait object. ```APIDOC ## GET /convert/as-any ### Description Converts `&Trait` (where `Trait: Downcast`) to `&Any`. This is needed since Rust cannot generate `&Any`’s vtable from `&Trait`’s. ### Method GET ### Endpoint /convert/as-any ### Parameters #### Query Parameters - **trait_ref** (Reference to Trait) - Required - The reference to the trait object. ### Response #### Success Response (200) - **any_ref** (&dyn Any + 'static) - A reference to `dyn Any`. #### Response Example ```json { "any_ref": "..." } ``` ``` ```APIDOC ## GET /convert/as-any-mut ### Description Converts `&mut Trait` (where `Trait: Downcast`) to `&mut Any`. This is needed since Rust cannot generate `&mut Any`’s vtable from `&mut Trait`’s. ### Method GET ### Endpoint /convert/as-any-mut ### Parameters #### Query Parameters - **mut_trait_ref** (&mut Trait) - Required - A mutable reference to the trait object. ### Response #### Success Response (200) - **mut_any_ref** (&mut dyn Any + 'static) - A mutable reference to `dyn Any`. #### Response Example ```json { "mut_any_ref": "..." } ``` ``` -------------------------------- ### WithSubscriber Implementations Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinKnockback_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Allows attaching subscribers to types for dispatching. ```APIDOC ## impl WithSubscriber for T ### Description Allows attaching subscribers to types for dispatching events. ### Method `with_subscriber` and `with_current_subscriber` ### Endpoint N/A (Trait implementation) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response - **WithDispatch** - A wrapper type that includes the subscriber. #### Response Example N/A ``` -------------------------------- ### Get TnuaObstacleRadar Up Direction Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/data_for_backends/struct.TnuaObstacleRadar Retrieves the `Dir3` representing the up direction relative to the entity that owns this `TnuaObstacleRadar` component. ```rust pub fn up_direction(&self) -> Dir3 ``` -------------------------------- ### Get &dyn Any from &T in Rust Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/control_helpers/struct.TnuaActionsCounter Obtains a reference to `dyn Any` from a reference `&T`. This is necessary because Rust cannot automatically generate the vtable for `&Any` from `&T`. ```rust fn as_any(&self) -> &(dyn Any + 'static) ``` -------------------------------- ### Rust: Implement CloneToUninit (Nightly) Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinWalkConfig Illustrates the `unsafe fn clone_to_uninit` implementation for `CloneToUninit`. This is a nightly-only experimental API for performing copy-assignment to uninitialized memory. ```rust impl CloneToUninit for T where T: Clone, { unsafe fn clone_to_uninit(&self, dest: *mut u8) // ... implementation details ... } ``` -------------------------------- ### TnuaPipelineSystems::equivalent Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinKnockback_search=u32+-%3E+bool Checks for equivalency between `TnuaPipelineSystems` types. ```APIDOC ## method bevy_tnua::TnuaPipelineSystems::equivalent ### Description Checks if two `TnuaPipelineSystems` types are equivalent. ### Parameters - `self`: A reference to the first `TnuaPipelineSystems` instance. - `other`: A reference to the second `TnuaPipelineSystems` instance. The type `K` must match `u32`. ### Return Type `bool` ``` -------------------------------- ### Get Entity from TnuaRadarBlipLens in Rust Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/radar_lens/struct.TnuaRadarBlipLens_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the entity that generated the radar blip. This method is part of the TnuaRadarBlipLens implementation. ```rust pub fn entity(&self) -> Entity ``` -------------------------------- ### Any Type Implementations Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinWalk_search=u32+-%3E+bool Provides methods for runtime type identification and downcasting. ```APIDOC ## impl Any for T ### Description Provides methods for runtime type identification and downcasting. ### Methods #### `fn type_id(&self) -> TypeId` Gets the `TypeId` of `self`. #### `fn into_any(self: Box) -> Box` Converts `Box` to `Box`. #### `fn into_any_rc(self: Rc) -> Rc` Converts `Rc` to `Rc`. #### `fn as_any(&self) -> &(dyn Any + 'static)` Converts `&Trait` to `&Any`. #### `fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)` Converts `&mut Trait` to `&mut Any`. ``` -------------------------------- ### Get Perpendicular Vector Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/math/type.Vector2_search= Returns a new DVec2 vector that is rotated 90 degrees from the original vector. ```rust pub fn perp(self) -> DVec2 ``` -------------------------------- ### DVec2 Default and Serialization Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/math/type.Vector2_search=u32+-%3E+bool Details how to get a default `DVec2` value and how it integrates with Serde for deserialization. ```APIDOC ## DVec2 Default and Serialization This section explains how to obtain a default `DVec2` and its deserialization capabilities. ### `impl Default for DVec2` Provides a default value for `DVec2`. - **Method**: `fn default() -> DVec2` - Description: Returns the “default value” for a type. ### `impl<'de> Deserialize<'de> for DVec2` Allows `DVec2` to be deserialized from data formats like JSON using Serde. - **Description**: Deserialize expects a sequence of 2 values. - **Method**: `fn deserialize(deserializer: D) -> Result>::Error>` - Description: Deserialize this value from the given Serde deserializer. - Constraints: `where D: Deserializer<'de>` ``` -------------------------------- ### Conversion Traits: Into, IntoEither, IntoResult, TryFrom, TryInto Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/struct.TnuaBasisContext_search=u32+-%3E+bool Documentation for various conversion traits, including `Into`, `IntoEither`, `IntoResult`, `TryFrom`, and `TryInto`. ```APIDOC ## `Into` Trait ### Description This trait allows a type `T` to be converted into another type `U`, provided that `U` implements `From`. ### Method #### `into(self) -> U` ##### Description Calls `U::from(self)`. The conversion behavior is determined by the `From for U` implementation. ##### Method `into` ## `IntoEither` Trait ### Description This trait enables conversion of a type into either the `Left` or `Right` variant of an `Either` enum. ### Methods #### `into_either(self, into_left: bool) -> Either` ##### Description Converts `self` into a `Left` variant if `into_left` is `true`, otherwise into a `Right` variant. ##### Method `into_either` #### `into_either_with(self, into_left: F) -> Either` ##### Description Converts `self` into a `Left` variant if the closure `into_left(&self)` returns `true`, otherwise into a `Right` variant. ##### Method `into_either_with` ## `IntoResult` Trait ### Description This trait allows a type to be converted into a `Result` with a specific output type `T` and a `RunSystemError`. ### Method #### `into_result(self) -> Result` ##### Description Converts this type into the system output type. ##### Method `into_result` ## `TryFrom` Trait ### Description This trait enables fallible conversion from a type `U` into another type `T`. ### Associated Type #### `Error = Infallible` ##### Description The type returned in the event of a conversion error. ### Method #### `try_from(value: U) -> Result>::Error>` ##### Description Performs the conversion. ##### Method `try_from` ## `TryInto` Trait ### Description This trait enables fallible conversion from a type `T` into another type `U`. ### Associated Types #### `Error = >::Error` ##### Description The type returned in the event of a conversion error. ### Method #### `try_into(self) -> Result>::Error>` ##### Description Performs the conversion. ##### Method `try_into` ``` -------------------------------- ### TryFrom Trait Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinWallSlideConfig Enables fallible conversion from one type to another. ```APIDOC ## impl TryFrom for T ### Description Performs the conversion. Returns `Ok(T)` on success or `Err(Self::Error)` on failure. ### Method `try_from(value: U) -> Result>::Error>` ``` -------------------------------- ### DynamicBundle Trait Implementation Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/data_for_backends/struct.TnuaRigidBodyTracker_search=std%3A%3Avec Defines an interface for components that can be dynamically bundled, including methods for getting and applying components. ```APIDOC ## impl DynamicBundle for C ### Description Defines an interface for components that can be dynamically bundled. ### Associated Types #### `type Effect = ()` An operation on the entity that happens after inserting this bundle. ### Methods #### `unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> ::Effect` Moves the components out of the bundle. #### `unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit>, _entity: &mut EntityWorldMut<'_>, )` Applies the after-effects of spawning this bundle. ``` -------------------------------- ### FromWorld Implementation Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinWalkConfig Details the `FromWorld` implementation for types that implement `Default`. ```APIDOC ## Blanket Implementation for FromWorld ### impl FromWorld for T where T: Default, Allows creating a type from the `World` if the type implements `Default`. #### fn from_world(_world: &mut World) -> T Creates `Self` using `default()`. ``` -------------------------------- ### Get Reference to dyn Any Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/data_for_backends/struct.TnuaGhostSensor_search=u32+-%3E+bool Provides a reference to a dynamic Any type from a trait object reference. ```APIDOC ## Get Reference to dyn Any ### Description Converts `&Trait` (where `Trait: Downcast`) to `&Any`. This is needed since Rust cannot generate `&Any`’s vtable from `&Trait`’s. ### Method `fn as_any(&self) -> &(dyn Any + 'static)` ### Endpoint N/A (Method Implementation) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (N/A) Returns a reference to `dyn Any`. #### Response Example None ``` -------------------------------- ### TnuaController Methods Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/controller/struct.TnuaController_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides details on methods available for the TnuaController, such as checking airborne status and getting the up direction. ```APIDOC ## GET /websites/rs_bevy-tnua_0_30_0_bevy_tnua/TnuaController/up_direction ### Description Returns the direction considered as up. The up direction is based on gravity and may be one frame behind. ### Method GET ### Endpoint /websites/rs_bevy-tnua_0_30_0_bevy_tnua/TnuaController/up_direction ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Option** - The up direction. #### Response Example ```json { "direction": { "x": 0.0, "y": 1.0, "z": 0.0 } } ``` ## GET /websites/rs_bevy-tnua_0_30_0_bevy_tnua/TnuaController/is_airborne ### Description Checks if the character is currently airborne. This is equivalent to using `TnuaBasisWithGround::is_airborne` on the controller's basis access. ### Method GET ### Endpoint /websites/rs_bevy-tnua_0_30_0_bevy_tnua/TnuaController/is_airborne ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Result** - Ok(true) if airborne, Ok(false) if not, or an error if the configuration has not been pulled. #### Response Example ```json { "is_airborne": true } ``` ``` -------------------------------- ### Settings Trait Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/struct.TnuaUserControlsSystems Documentation for the Settings trait. ```APIDOC ## Trait: Settings ### Description Represents a type that can be used for settings. ### Constraints - `T: 'static + Send + Sync` ``` -------------------------------- ### Getting &dyn Any from &T in Rust Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/struct.TnuaRigidBodyTracker Provides a reference to a `dyn Any` from a reference `&T`, where `T` implements `Downcast`. This is necessary because Rust cannot directly generate the vtable for `&Any` from `&T`. ```rust impl Downcast for T where T: Any, { fn as_any(&self) -> &(dyn Any + 'static) // ... implementation details ... } ``` -------------------------------- ### Subscriber and Settings Traits Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/struct.TnuaBasisContext_search=u32+-%3E+bool Documentation for the `WithSubscriber` and `Settings` traits, related to managing subscribers and configuration. ```APIDOC ## `WithSubscriber` Trait ### Description This trait allows attaching a `Subscriber` or the default `Subscriber` to a type. ### Methods #### `with_subscriber(self, subscriber: S) -> WithDispatch` ##### Description Attaches the provided `Subscriber` to this type, returning a `WithDispatch` wrapper. ##### Method `with_subscriber` #### `with_current_subscriber(self) -> WithDispatch` ##### Description Attaches the current default `Subscriber` to this type, returning a `WithDispatch` wrapper. ##### Method `with_current_subscriber` ## `Settings` Trait ### Description This trait is implemented for types that are `'static`, `Send`, and `Sync`, suggesting they can be used as settings. ### Constraints `T: 'static + Send + Sync` ``` -------------------------------- ### TnuaUserControlsSystems::equivalent Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinKnockback_search=u32+-%3E+bool Checks for equivalency between `TnuaUserControlsSystems` types. ```APIDOC ## method bevy_tnua::TnuaUserControlsSystems::equivalent ### Description Checks if two `TnuaUserControlsSystems` types are equivalent. ### Parameters - `self`: A reference to the first `TnuaUserControlsSystems` instance. - `other`: A reference to the second `TnuaUserControlsSystems` instance. The type `K` must match `u32`. ### Return Type `bool` ``` -------------------------------- ### Get mutable reference to dyn Any Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/struct.TnuaGhostSensor_search= Obtains a mutable reference to a dynamic Any type from a mutable trait object reference. ```APIDOC ## GET /as_any_mut ### Description Converts `&mut Trait` (where `Trait: Downcast`) to `&Any`. This is needed since Rust cannot generate `&mut Any`’s vtable from `&mut Trait`’s. ### Method GET ### Endpoint `/as_any_mut` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example (No request body for this operation) ### Response #### Success Response (200) - **&mut (dyn Any + 'static)** - A mutable reference to the dynamic Any type. #### Response Example ```json { "result": "&mut ANY_TYPE" } ``` ``` -------------------------------- ### Get Index of Maximum Element in DVec3 Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/math/type.Vector3_search= Returns the index of the first occurrence of the maximum element in a DVec3. ```rust pub fn max_position(self) -> usize ``` -------------------------------- ### Serialize Implementations Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinWalk_search=u32+-%3E+bool Enables serialization of types into various formats. ```APIDOC ## impl Serialize for T ### Description Enables serialization of types into various formats. ### Methods #### `fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>` Serializes the type using an erased serializer. #### `fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>` Performs erased serialization. ``` -------------------------------- ### TryInto and TryFrom Traits Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/struct.TnuaSystems_search= Documentation for the TryInto and TryFrom traits, used for fallible conversions. ```APIDOC ## Trait: TryInto ### Description Provides a fallible conversion from `T` to `U`. ### Associated Types #### `type Error = >::Error` ##### Description The type returned in the event of a conversion error. ### Methods #### `try_into(self) -> Result>::Error>` ##### Description Performs the fallible conversion from `self` (type `T`) to type `U`. ##### Method `try_into` ##### Parameters None ##### Return Value A `Result` where `U` is the target type and `E` is the error type. `Ok(U)` on success, `Err(E)` on failure. ##### Example ```rust // Assuming 'value' is of type T and can be converted to U match value.try_into() { Ok(converted_value) => { // Use converted_value of type U } Err(error) => { // Handle conversion error } } ``` ## Trait: TryFrom ### Description Provides a fallible conversion from `U` to `T`. ### Methods #### `try_from(value: U) -> Result>::Error>` ##### Description Performs the fallible conversion from the given `value` (type `U`) to type `T`. ##### Method `try_from` ##### Parameters - **value** (U) - Required - The value to convert. ##### Return Value A `Result` where `T` is the target type and `E` is the error type. `Ok(T)` on success, `Err(E)` on failure. ##### Example ```rust // Assuming 'input_value' is of type U and can be converted to T match MyType::try_from(input_value) { Ok(converted_value) => { // Use converted_value of type T } Err(error) => { // Handle conversion error } } ``` ``` -------------------------------- ### DVec3 Element Index Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/math/type.Vector3_search=std%3A%3Avec Gets the index of the first occurrence of the minimum or maximum element in the DVec3 vector. ```APIDOC ## GET /dvec3/min_position ### Description Returns the index of the first minimum element of the DVec3 vector. ### Method GET ### Endpoint /dvec3/min_position ### Parameters #### Query Parameters - **vec** (DVec3) - Required - The vector to find the minimum element's index. ### Response #### Success Response (200) - **result** (usize) - The index of the first minimum element (0, 1, or 2). #### Response Example ```json { "result": 0 } ``` ## GET /dvec3/max_position ### Description Returns the index of the first maximum element of the DVec3 vector. ### Method GET ### Endpoint /dvec3/max_position ### Parameters #### Query Parameters - **vec** (DVec3) - Required - The vector to find the maximum element's index. ### Response #### Success Response (200) - **result** (usize) - The index of the first maximum element (0, 1, or 2). #### Response Example ```json { "result": 1 } ``` ``` -------------------------------- ### `DynamicBundle` Trait Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/data_for_backends/struct.TnuaSensorOf_search= Defines methods for handling component bundles in a dynamic manner, including getting and applying effects. ```APIDOC ## Dynamic Bundle Component Handling ### Description Provides methods for moving components out of a bundle and applying any associated effects after entity spawning. ### Methods - `get_components`: Moves components out of the bundle. - `apply_effect`: Applies the after-effects of spawning this bundle. ### Endpoint N/A (Methods within an `impl` block) ### Parameters - `get_components`: - `ptr` (MovingPtr<'_, C>) - Pointer to the component data. - `func` (&mut impl FnMut(StorageType, OwningPtr<'_>)) - A closure to handle the extracted components. - `apply_effect`: - `_ptr` (MovingPtr<'_, MaybeUninit>) - Pointer to the component data (may be uninitialized). - `_entity` (&mut EntityWorldMut<'_>) - Mutable reference to the entity world. ### Request Example ```rust // Example usage within a system or bundle processing context // unsafe { bundle.get_components(ptr, |storage, component_ptr| { ... }); } // unsafe { bundle.apply_effect(ptr, entity_mut); } ``` ### Response #### Success Response (200) - **Effect**: The type associated with the bundle's effect (often `()`). #### Response Example ```json // No direct JSON response, this is a Rust type conversion. ``` ``` -------------------------------- ### Settings Trait Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/controller/struct.TnuaControllerPlugin_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Documentation for the `Settings` trait. ```APIDOC ## `Settings` Trait ### Description This trait is implemented for types that hold configuration or settings, typically requiring them to be static, sendable, and synchronizable across threads. ### Constraint - `T: 'static + Send + Sync` ``` -------------------------------- ### Initialization and Witness Traits Source: https://docs.rs/bevy-tnua/0.30.0/bevy_tnua/builtins/struct.TnuaBuiltinJump_search=u32+-%3E+bool This section covers traits related to object initialization from a world context and type-level witnesses. ```APIDOC ## Trait: FromWorld ### Description Allows creating a type instance from a `World` context. ### Method `_world: &mut World` ### Endpoint N/A (Method within a trait) ### Function Signature `fn from_world(_world: &mut World) -> T` where `T: Default` ### Description Creates an instance of `Self` by calling its `default()` method. --- ## Trait: HasTypeWitness ### Description Provides access to a type-level witness. ### Method N/A (Associated Constant) ### Endpoint N/A (Associated Constant within a trait) ### Associated Constant `const WITNESS: W = W::MAKE` where `W: MakeTypeWitness` ### Description A constant representing the type witness, generated by `MakeTypeWitness`. ```