### Bundle Implementations Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol/struct.VpeolCameraState_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Documentation for `impl Bundle` and `impl BundleFromComponents`. ```APIDOC ## Bundle Implementations ### `impl Bundle for C` where `C: Component` #### `fn component_ids(components: &mut ComponentsRegistrator<'_>) -> impl Iterator` #### `fn get_component_ids(components: &Components) -> impl Iterator>` Returns an iterator over this [`Bundle`]'s component ids. This will be `None` if the component has not been registered. ### `impl BundleFromComponents for C` where `C: Component` #### `unsafe fn from_components(ctx: &mut T, func: &mut F) -> C` where `F: for<'a> FnMut(&'a mut T) -> OwningPtr<'a>` ``` -------------------------------- ### Example Usage of YoleckSyncWithEditorState (Rust) Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckSyncWithEditorState_search=std%3A%3Avec Provides a practical example of how to integrate YoleckSyncWithEditorState into a Bevy application. It shows conditional plugin addition based on whether the executable started in editor mode, including necessary plugins like EguiPlugin and YoleckPluginForEditor or YoleckPluginForGame, and how to initialize states. ```rust #[derive(States, Default, Debug, Clone, PartialEq, Eq, Hash)] enum GameState { #[default] Loading, Game, Editor, } if executable_started_in_editor_mode { // These two plugins are needed for editor mode: app.add_plugins(EguiPlugin::default()); app.add_plugins(YoleckPluginForEditor); app.add_plugins(YoleckSyncWithEditorState { when_editor: GameState::Editor, when_game: GameState::Game, }); } else { // This plugin is needed for game mode: app.add_plugins(YoleckPluginForGame); app.init_state::(); } ``` -------------------------------- ### Get Element Index from Reference (Rust - Nightly) Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckLevelIndex_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Returns the byte index of an element within a slice, given a reference to that element. Returns None if the reference is not aligned with the start of an element. This method uses pointer arithmetic and does not compare elements. ```rust #![feature(substr_range)] let nums: &[u32] = &[1, 7, 1, 1]; let num = &nums[2]; assert_eq!(num, &1); assert_eq!(nums.element_offset(num), Some(2)); ``` ```rust #![feature(substr_range)] let arr: &[[u32; 2]] = &[[0, 1], [2, 3]]; let flat_arr: &[u32] = arr.as_flattened(); let ok_elm: &[u32; 2] = flat_arr[0..2].try_into().unwrap(); let weird_elm: &[u32; 2] = flat_arr[1..3].try_into().unwrap(); assert_eq!(ok_elm, &[0, 1]); assert_eq!(weird_elm, &[1, 2]); assert_eq!(arr.element_offset(ok_elm), Some(0)); // Points to element 0 assert_eq!(arr.element_offset(weird_elm), None); // Points between element 0 and 1 ``` -------------------------------- ### Into Implementations Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol/struct.VpeolCameraState_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Documentation for `impl Into for T` and `impl IntoEither for T`. ```APIDOC ## Into Implementations ### `impl Into for T` where `U: From` #### `fn into(self) -> U` Calls `U::from(self)`. That is, this conversion is whatever the implementation of `From for U` chooses to do. ### `impl IntoEither for T` #### `fn into_either(self, into_left: bool) -> Either` Converts `self` into a `Left` variant of `Either` if `into_left` is `true`. Converts `self` into a `Right` variant of `Either` otherwise. ``` -------------------------------- ### Get Element Offset in Slice (Rust - Nightly) Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckLevelIndex Returns the byte index of an element reference within a slice. Returns None if the element reference is not aligned with the start of an element. This method uses pointer arithmetic and does not compare elements. Requires the `substr_range` feature. ```Rust #![feature(substr_range)] let nums: &[u32] = &[1, 7, 1, 1]; let num = &nums[2]; assert_eq!(num, &1); assert_eq!(nums.element_offset(num), Some(2)); let arr: &[[u32; 2]] = &[[0, 1], [2, 3]]; let flat_arr: &[u32] = arr.as_flattened(); let ok_elm: &[u32; 2] = flat_arr[0..2].try_into().unwrap(); let weird_elm: &[u32; 2] = flat_arr[1..3].try_into().unwrap(); assert_eq!(ok_elm, &[0, 1]); assert_eq!(weird_elm, &[1, 2]); assert_eq!(arr.element_offset(ok_elm), Some(0)); // Points to element 0 assert_eq!(arr.element_offset(weird_elm), None); // Points between element 0 and 1 ``` -------------------------------- ### From and FromWorld Implementations Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol/struct.VpeolCameraState_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Documentation for `impl From for T` and `impl FromWorld for T`. ```APIDOC ## From and FromWorld Implementations ### `impl From for T` #### `fn from(t: T) -> T` Returns the argument unchanged. ### `impl FromWorld for T` where `T: Default` #### `fn from_world(_world: &mut World) -> T` Creates `Self` using `default()`. ``` -------------------------------- ### YoleckMarking as a Bevy SystemParam: Application and Queuing Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckMarking Details the `apply` and `queue` methods for the `SystemParam` implementation. These methods handle the application of deferred mutations and queuing for future application, respectively. ```rust fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World) fn queue( state: &mut Self::State, system_meta: &SystemMeta, world: DeferredWorld<'_>, ) ``` -------------------------------- ### Field Access Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_2d/struct.Vpeol2dCameraControl Provides methods to get or mutably get a field by name, downcasting to a specific type. ```APIDOC ## GET /field ### Description Retrieves a field from a struct by its name, with optional type downcasting. ### Method GET ### Endpoint `/field/{name}` ### Parameters #### Path Parameters - **name** (string) - Required - The name of the field to retrieve. #### Query Parameters - **type** (string) - Optional - The expected type of the field for downcasting. ### Request Example ```json { "example": "Not applicable for GET request, parameters are in path/query." } ``` ### Response #### Success Response (200) - **field_value** (any) - The value of the field, potentially downcasted to the requested type. #### Response Example ```json { "example": "field_value: \"some_value\"" } ``` ## PUT /field_mut ### Description Retrieves a mutable reference to a field from a struct by its name, with optional type downcasting. ### Method PUT ### Endpoint `/field_mut/{name}` ### Parameters #### Path Parameters - **name** (string) - Required - The name of the field to retrieve mutably. #### Query Parameters - **type** (string) - Optional - The expected type of the field for downcasting. ### Request Example ```json { "example": "Not applicable for PUT request, parameters are in path/query." } ``` ### Response #### Success Response (200) - **field_value_mut** (any) - A mutable reference to the field's value, potentially downcasted. #### Response Example ```json { "example": "field_value_mut: \"mutable_value\"" } ``` ``` -------------------------------- ### Conversion Traits (`Into`, `From`, `TryFrom`, `TryInto`) Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol/struct.VpeolRootResolver_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Documentation for standard Rust conversion traits and their implementations. ```APIDOC ## Conversion Traits ### `Into` and `From` These traits facilitate conversions between types. `Into` calls `U::from(self)`. - **`into(self) -> U`**: Converts `self` into type `U`. ### `TryFrom` and `TryInto` These traits provide fallible conversions. - **`try_from(value: U) -> Result>::Error>`**: Attempts to convert `value` into `T`. - **`try_into(self) -> Result>::Error>`**: Attempts to convert `self` into `U`. - **`Error` Type**: The error type for these conversions. ``` -------------------------------- ### Get Path Information using ReflectPath Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_2d/struct.Vpeol2dRotatation_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides methods to get a reference or a mutable reference to a value specified by a path. It also allows getting a statically typed reference or mutable reference to a value at a given path. These functions are part of the `GetPath` trait. ```rust 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, ``` -------------------------------- ### YoleckPopulate as SystemParam Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckPopulate_search=u32+-%3E+bool Documentation for YoleckPopulate's implementation as a Bevy SystemParam, detailing its state, item type, and initialization methods. ```APIDOC ## SystemParam Implementation for YoleckPopulate ### Description This section details how `YoleckPopulate` is implemented as a Bevy `SystemParam`, enabling its use within Bevy systems. ### Associated Types - `State`: `FetchState` - Used to store data that persists across system invocations. - `Item<'w, 's>`: `YoleckPopulate<'w, 's, Q, F>` - The type returned when constructing the system param, which is `Self` instantiated with appropriate lifetimes. ### Methods - `init_state(world: &mut World) -> Self::State` - Creates a new instance of the param's `State`. - `init_access(state: &Self::State, system_meta: &mut SystemMeta, component_access_set: &mut FilteredAccessSet, world: &mut World)` - Registers any `World` access used by this `SystemParam`. - `apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)` - Applies any deferred mutations stored in the `SystemParam`'s state. - `queue(state: &mut Self::State, system_meta: &SystemMeta, world: DeferredWorld<'_>)` - Queues any deferred mutations to be applied at the next `ApplyDeferred`. - `validate_param<'w, 's>(state: &'s mut Self::State, _system_meta: &SystemMeta, _world: UnsafeWorldCell<'w>) -> Result<(), SystemParamValidationError>` - Validates that the param can be acquired by `get_param`. - `get_param<'w, 's>(state: &'s mut Self::State, system_meta: &SystemMeta, world: UnsafeWorldCell<'w>, change_tick: Tick) -> Self::Item<'w, 's>` - Creates a parameter to be passed into a `SystemParamFunction`. ``` -------------------------------- ### GET /slice/as_array Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckLevelIndex_search=u32+-%3E+bool Attempts to get a reference to the underlying array if the specified size matches the slice length. This is a nightly-only experimental API. ```APIDOC ## GET /slice/as_array ### Description Attempts to get a reference to the underlying array. Returns `None` if the provided size `N` does not exactly match the length of the slice. This is a nightly-only experimental API. ### Method GET ### Endpoint `/slice/as_array` ### Parameters #### Query Parameters - **N** (usize) - Required - The expected size of the array. ### Response #### Success Response (200) - **array_ref** (&[T; N]) - A reference to the underlying array if the size matches. - **None** - If the size `N` does not match the slice length. #### Response Example ```json { "array_ref": ["value1", "value2"] } ``` ```json { "array_ref": null } ``` ``` -------------------------------- ### YoleckMarking as a Bevy SystemParam: Initialization and Access Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckMarking Covers the `init_state` and `init_access` methods for the `SystemParam` implementation of `YoleckMarking`. These methods are responsible for creating the parameter's state and registering its world access patterns. ```rust fn init_state(world: &mut World) -> Self::State fn init_access( state: &Self::State, system_meta: &mut SystemMeta, component_access_set: &mut FilteredAccessSet, world: &mut World, ) ``` -------------------------------- ### Get Slice Length in Rust Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckLevelIndex_search=u32+-%3E+bool Demonstrates how to get the number of elements in a slice using the `len()` method. This is a common operation for collections. ```rust let a = [1, 2, 3]; assert_eq!(a.len(), 3); ``` -------------------------------- ### CloneToUninit Trait Implementation Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_3d/struct.Vpeol3dCameraControl_search=u32+-%3E+bool Provides an experimental method for cloning data into uninitialized memory. ```APIDOC ## CloneToUninit Trait Implementation ### Description Provides an experimental, nightly-only method for performing copy-assignment from `self` to uninitialized memory. ### Methods #### `unsafe fn clone_to_uninit(&self, dest: *mut u8)` Performs copy-assignment from `self` to `dest`. ``` -------------------------------- ### Get UUID from YoleckEntityUuid (Rust) Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckEntityUuid Provides the `get` method for the YoleckEntityUuid struct, which returns the associated Uuid. This allows retrieval of the persistent identifier for an entity. ```rust pub fn get(&self) -> Uuid ``` -------------------------------- ### SystemParam Implementations for VpeolRootResolver Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol/struct.VpeolRootResolver_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Documentation for the SystemParam trait implementations for VpeolRootResolver, detailing how it integrates with Bevy's system execution. ```APIDOC ## impl SystemParam for VpeolRootResolver<'_, '_> ### Description Provides the necessary implementations for `VpeolRootResolver` to be used as a `SystemParam` in Bevy. ### Associated Types - **State**: `FetchState` - Used to store data which persists across invocations of a system. - **Item<'w, 's>**: `VpeolRootResolver<'w, 's>` - The item type returned when constructing this system param. ### Methods - **init_state(world: &mut World) -> Self::State**: Creates a new instance of this param’s `State`. - **init_access(state: &Self::State, system_meta: &mut SystemMeta, component_access_set: &mut FilteredAccessSet, world: &mut World)**: Registers any [`World`] access used by this [`SystemParam`]. - **apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)**: Applies any deferred mutations stored in this [`SystemParam`]'s state. - **queue(state: &mut Self::State, system_meta: &SystemMeta, world: DeferredWorld<'_>)**: Queues any deferred mutations to be applied at the next `ApplyDeferred`. - **validate_param<'w, 's>(state: &'s mut Self::State, _system_meta: &SystemMeta, _world: UnsafeWorldCell<'w>) -> Result<(), SystemParamValidationError>** (unsafe): Validates that the param can be acquired by the `get_param`. - **get_param<'w, 's>(state: &'s mut Self::State, system_meta: &SystemMeta, world: UnsafeWorldCell<'w>, change_tick: Tick) -> Self::Item<'w, 's>** (unsafe): Creates a parameter to be passed into a `SystemParamFunction`. ### Source ```rust impl SystemParam for VpeolRootResolver<'_, '_> ``` ``` -------------------------------- ### Get as Array Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckLevelIndex_search= Attempts to get a reference to the underlying array if the specified length `N` matches the slice's length. This is a nightly-only experimental API. ```APIDOC ## GET /slice/as_array/{N} ### Description Gets a reference to the underlying array if the specified length `N` exactly matches the length of the slice. Returns `None` otherwise. This is a nightly-only experimental API. ### Method GET ### Endpoint `/slice/as_array/{N}` ### Parameters #### Path Parameters - **N** (usize) - Required - The expected length of the array. ### Response #### Success Response (200) - **array_ref** (&[T; N]) - A reference to the underlying array if the length matches, otherwise `None`. #### Response Example ```json { "array_ref": [1, 2, 3] } ``` ``` -------------------------------- ### Get Reflect Path Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_3d/struct.Vpeol3dCameraControl_search=std%3A%3Avec Enables navigating and accessing nested values within a `Reflect` type using a path. It supports both getting immutable and mutable references to the target value. ```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; } ``` -------------------------------- ### Settings Trait Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/struct.YoleckPopulateContext_search=u32+-%3E+bool Documentation for the `Settings` trait, requiring types to be `'static`, `Send`, and `Sync`. ```APIDOC ## Settings for T ### Description Requires that the type `T` must be `'static`, `Send`, and `Sync`, indicating it has no non-`'static` references and can be safely shared across threads. ### Endpoint N/A (Trait Implementation) ### Parameters None ### Request Body None ### Response None ### Response Example N/A (Trait Implementation) ``` -------------------------------- ### Create Bundle from Components (Rust) Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_3d/struct.Vpeol3dCameraControl_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Unsafely constructs a `Bundle` from a provided context and a function that supplies components. This is an advanced API for custom bundle creation. ```rust unsafe fn from_components(ctx: &mut T, func: &mut F) -> C where F: for<'a> FnMut(&'a mut T) -> OwningPtr<'a> ``` -------------------------------- ### Get Field by Name (Rust) Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_2d/struct.Vpeol2dCameraControl_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides methods to get a reference or a mutable reference to a field by its name, downcasting it to a specific type T. Requires the field's type to implement the Reflect trait. ```rust fn get_field(&self, name: &str) -> Option<&T> where T: Reflect ``` ```rust fn get_field_mut(&mut self, name: &str) -> Option<&mut T> where T: Reflect ``` -------------------------------- ### Split Slice from End - Rust Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckLevelIndex Splits a slice into subslices based on a predicate, starting from the end. The delimiter element is not included. Handles cases where delimiters are at the start or end, resulting in empty subslices. ```Rust let slice = [11, 22, 33, 0, 44, 55]; let mut iter = slice.rsplit(|num| *num == 0); assert_eq!(iter.next().unwrap(), &[44, 55]); assert_eq!(iter.next().unwrap(), &[11, 22, 33]); assert_eq!(iter.next(), None); let v = &[0, 1, 1, 2, 3, 5, 8]; let mut it = v.rsplit(|n| *n % 2 == 0); assert_eq!(it.next().unwrap(), &[]); assert_eq!(it.next().unwrap(), &[3, 5]); assert_eq!(it.next().unwrap(), &[1, 1]); assert_eq!(it.next().unwrap(), &[]); assert_eq!(it.next(), None); ``` -------------------------------- ### BundleFromComponents Implementation Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/struct.YoleckSystemMarker_search=std%3A%3Avec Provides functionality to create bundles from components. ```APIDOC ## impl BundleFromComponents for C ### Description Provides functionality to create bundles from components. ### Methods #### `from_components(ctx: &mut T, func: &mut F) -> C` - **Description**: This is an unsafe function that constructs a component `C` using a context `T` and a function `F` that provides owning pointers. - **Parameters**: - `ctx` (*mut T): A mutable reference to the context. - `func` (*mut F): A mutable reference to a function that returns an `OwningPtr`. - **Returns**: `C` - The constructed component. ``` -------------------------------- ### Get Struct Field by Name in Rust Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_3d/struct.Vpeol3dCameraControl Implements `GetField` for structs, allowing retrieval of field values by name. It provides methods to get immutable or mutable references to fields, downcast to a specific type `T` that implements `Reflect`. ```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; } ``` -------------------------------- ### TryFrom and TryInto Methods Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/knobs/struct.KnobFromCache Methods for attempting conversions that may fail. ```APIDOC ## `try_from` and `try_into` ### Description These methods facilitate fallible conversions between types. `try_from` attempts a conversion from a source type `U` to a target type `T`, while `try_into` attempts the reverse. Both return a `Result` to indicate success or failure. ### Method `try_from(value: U) -> Result>::Error>` (for `TryFrom` trait) `try_into(self) -> Result>::Error>` (for `TryInto` trait) ### Endpoint N/A (These are trait methods, not API endpoints) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (N/A) Returns a `Result` containing the converted value on success, or an error on failure. #### Response Example None ``` -------------------------------- ### Equivalent Method Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/struct.YoleckPopulateContext_search=u32+-%3E+bool Documentation for the `equivalent` method found in various Bevy Yoleck types, used for type checking. ```APIDOC ## equivalent Method ### Description Checks if the current type is equivalent to another type `K` where `u32` matches `K`. This is typically used for type identification within generic contexts. ### Method `equivalent(&self, &K) -> bool` ### Endpoint N/A (Method Implementation) ### Parameters - **K** (type) - The type to compare against. ### Request Body None ### Response #### Success Response - **bool** (type) - `true` if the types are equivalent, `false` otherwise. ### Response Example N/A (Method Implementation) ``` -------------------------------- ### Get Field by Name (Struct Reflection) Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_3d/struct.Vpeol3dCameraControl_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides methods to get a reference or mutable reference to a struct field by its name. The field value is downcast to a specified `Reflect` type, returning `None` if the field does not exist or cannot be downcast. ```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 Entity by UUID using YoleckUuidRegistry (Rust) Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckUuidRegistry_search= Demonstrates the 'get' method of the YoleckUuidRegistry, which allows retrieving an Option based on a provided Uuid. This is the primary function for looking up entities by their unique identifiers within the registry. ```rust pub fn get(&self, uuid: Uuid) -> Option ``` -------------------------------- ### TryInto Function Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_3d/struct.Vpeol3dPosition_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Documentation for the `try_into` function, which performs conversions. ```APIDOC ## Function: try_into ### Description Performs the conversion from type `T` to type `U`. ### Signature `fn try_into(self) -> Result>::Error>` ### Type Parameters - `T`: The source type. - `U`: The target type, which must implement `TryFrom`. ``` -------------------------------- ### Tuple Struct Field Access for Vpeol3dPosition Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_3d/struct.Vpeol3dPosition_search=std%3A%3Avec Enables accessing individual fields of `Vpeol3dPosition` when treated as a tuple struct. It provides methods to get references to fields by index, get the total number of fields, and iterate over them. ```rust fn field(&self, index: usize) -> Option<&dyn PartialReflect> fn field_mut(&mut self, index: usize) -> Option<&mut dyn PartialReflect> fn field_len(&self) -> usize fn iter_fields(&self) -> TupleStructFieldIter<'_> ``` -------------------------------- ### Dynamic Bundle Creation from Components Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_2d/struct.Vpeol2dPosition_search=std%3A%3Avec Illustrates the `BundleFromComponents` trait implementation, which allows for the unsafe creation of a bundle from a context and a function that provides components. ```rust impl BundleFromComponents for C where C: Component, unsafe fn from_components(ctx: &mut T, func: &mut F) -> C where F: for<'a> FnMut(&'a mut T) -> OwningPtr<'a> ``` -------------------------------- ### Get Slice as Fixed-Size Array (Rust - Nightly) Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckLevelIndex_search=u32+-%3E+bool Attempts to get a reference to the underlying data as a fixed-size array of length `N`. Returns `None` if `N` does not match the slice's length. This is an experimental API. ```rust pub fn as_array(&self) -> Option<&[T; N]> ``` -------------------------------- ### Standard Conversions Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol/struct.VpeolRouteClickTo_search= Implements standard Rust conversion traits like `From`, `Into`, `TryFrom`, and `TryInto`. ```APIDOC ## Standard Conversions ### Description This section covers standard conversion traits available for types within this library, enabling seamless data transformations. ### Traits #### `impl From for T` ##### Method `fn from(t: T) -> T` Returns the argument unchanged. #### `impl Into for T where U: From` ##### Method `fn into(self) -> U` Calls `U::from(self)`. #### `impl TryFrom for T where U: Into` ##### Associated Type `type Error = Infallible` ##### Method `fn try_from(value: U) -> Result>::Error>` Performs the conversion. #### `impl TryInto for T where U: TryFrom` ##### Associated Type `type Error = >::Error` ##### Method `fn try_into(self) -> Result>::Error>` Performs the conversion. ``` -------------------------------- ### TryFrom and TryInto Methods Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol/struct.YoleckKnobClick_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Methods for attempting conversions between types, returning a Result. ```APIDOC ## `TryFrom` and `TryInto` Traits ### `try_from(value: U) -> Result>::Error>` Performs the conversion. The associated `Error` type is `Infallible`. ### `try_into(self) -> Result>::Error>` Performs the conversion. The associated `Error` type is the same as for `TryFrom`. ``` -------------------------------- ### Get Path via Reflect Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_3d/struct.Vpeol3dCameraControl_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Implements methods to get references (mutable or immutable) to values within a structure using a path. It supports both general `PartialReflect` references and statically typed references, returning a `Result` that indicates success or a `ReflectPathError`. ```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, } ``` -------------------------------- ### Basic Iterator Operations for Boxed Iterators Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/exclusive_systems/type.YoleckExclusiveSystem_search=u32+-%3E+bool Standard iterator methods for a boxed iterator. These include retrieving the next item (`next`), getting size hints (`size_hint`), accessing the nth item (`nth`), and getting the last item (`last`). ```rust fn next(&mut self) -> Option<::Item> fn size_hint(&self) -> (usize, Option) fn nth(&mut self, n: usize) -> Option<::Item> fn last(self) -> Option<::Item> ``` -------------------------------- ### TryFrom and TryInto Conversions Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/knobs/struct.YoleckKnobs Provides fallible conversion methods between types. ```APIDOC ## POST /try_from ### Description Performs a fallible conversion from one type to another. ### Method POST ### Endpoint `/try_from` ### Parameters #### Request Body - **value** (U) - Required - The value to convert. ### Request Example ```json { "value": "..." } ``` ### Response #### Success Response (200) - **converted_value** (T) - The successfully converted value. #### Error Response (400) - **error** (Infallible) - The error type indicating conversion failure. #### Response Example ```json { "converted_value": "..." } ``` ``` ```APIDOC ## POST /try_into ### Description Performs a fallible conversion from one type to another using `TryInto`. ### Method POST ### Endpoint `/try_into` ### Parameters #### Request Body - **value** (T) - Required - The value to convert. ### Request Example ```json { "value": "..." } ``` ### Response #### Success Response (200) - **converted_value** (U) - The successfully converted value. #### Error Response (400) - **error** (>::Error) - The error type indicating conversion failure. #### Response Example ```json { "converted_value": "..." } ``` ``` -------------------------------- ### Example: Insert YoleckCameraChoices Resource (Rust) Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_3d/struct.YoleckCameraChoices_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Demonstrates how to insert a YoleckCameraChoices resource into a Bevy application. This example shows how to configure a custom camera mode named 'Isometric' with specific control settings, position, look-at, and up vectors. ```rust app.insert_resource( YoleckCameraChoices::default() .choice_with_transform( "Isometric", { let mut control = Vpeol3dCameraControl::fps(); control.mode = Vpeol3dCameraMode::Custom(2); control.allow_rotation_while_maintaining_up = None; control }, Vec3::new(10.0, 10.0, 10.0), Vec3::ZERO, Vec3::Y, ) ); ``` -------------------------------- ### Settings Implementation Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_3d/struct.Vpeol3dSnapToPlane_search= Provides settings for types that meet specific criteria. ```APIDOC ## Settings Trait ### Description This trait provides settings for types that meet specific lifetime and threading requirements. ### Constraints - `T: 'static + Send + Sync` ``` -------------------------------- ### Box HasDisplayHandle and HasWindowHandle Implementations (Rust) Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/exclusive_systems/type.YoleckExclusiveSystem These implementations provide methods to get display and window handles for a boxed type `Box`. The `display_handle` method retrieves a handle to the display controller, and `window_handle` gets a handle to the window. ```rust fn display_handle(&self) -> Result, HandleError> Get a handle to the display controller of the windowing system. § ``` ```rust fn window_handle(&self) -> Result, HandleError> Get a handle to the window. 1.0.0 · Source§ ``` -------------------------------- ### CloneToUninit Implementation Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/struct.YoleckSystemMarker_search=std%3A%3Avec Enables cloning components into uninitialized memory. This is a nightly-only experimental API. ```APIDOC ## impl CloneToUninit for T ### Description Enables cloning components into uninitialized memory. This is a nightly-only experimental API. ### Methods #### `clone_to_uninit(&self, dest: *mut u8)` - **Description**: Performs copy-assignment from `self` to the uninitialized memory pointed to by `dest`. - **Parameters**: - `dest` (*mut u8): A mutable pointer to the destination memory. - **Note**: This is an experimental API and requires a nightly Rust compiler. ``` -------------------------------- ### Get Statically Typed Reference with Path (Rust) Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_3d/enum.Vpeol3dCameraMode Provides methods to get a statically typed reference or a mutable reference to a value within a structure using a specified path. These methods are generic over the path type and require the target type to implement the `Reflect` trait. ```rust 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, ``` -------------------------------- ### Conversions Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_2d/struct.Vpeol2dCameraControl Provides methods for converting between types using `From`, `Into`, `TryFrom`, and `TryInto` traits. ```APIDOC ## POST /into ### Description Converts a value into another type using the `Into` trait. ### Method POST ### Endpoint `/into` ### Parameters #### Request Body - **value** (any) - Required - The value to convert. - **target_type** (string) - Required - The type to convert into. ### Request Example ```json { "example": { "value": 10, "target_type": "String" } } ``` ### Response #### Success Response (200) - **converted_value** (any) - The converted value. #### Response Example ```json { "example": "converted_value: \"10\"" } ``` ## POST /try_from ### Description Attempts to convert a value into another type using the `TryFrom` trait. ### Method POST ### Endpoint `/try_from` ### Parameters #### Request Body - **value** (any) - Required - The value to convert. - **target_type** (string) - Required - The type to convert into. ### Request Example ```json { "example": { "value": "abc", "target_type": "i32" } } ``` ### Response #### Success Response (200) - **result** (Result) - The result of the conversion (Ok or Err). #### Response Example ```json { "example": "result: Ok(123)" } ``` ## POST /try_into ### Description Attempts to convert a value into another type using the `TryInto` trait. ### Method POST ### Endpoint `/try_into` ### Parameters #### Request Body - **value** (any) - Required - The value to convert. - **target_type** (string) - Required - The type to convert into. ### Request Example ```json { "example": { "value": 123, "target_type": "String" } } ``` ### Response #### Success Response (200) - **result** (Result) - The result of the conversion (Ok or Err). #### Response Example ```json { "example": "result: Ok(\"123\")" } ``` ``` -------------------------------- ### wrap_mode Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckUi_search=u32+-%3E+bool Gets the text wrapping mode for the UI. ```APIDOC ## pub fn wrap_mode(&self) -> TextWrapMode ### Description Returns the `TextWrapMode` currently applied to the UI. This determines how text is wrapped within the UI elements, influenced by style and layout. ### Method `wrap_mode` ### Endpoint N/A ### Parameters N/A ### Request Example N/A (This is a getter method) ### Response #### Success Response (200) - **return value** (TextWrapMode) - The current text wrapping mode. #### Response Example ```rust let wrap_mode = ui.wrap_mode(); ``` ``` -------------------------------- ### TryFrom and TryInto Traits Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol_3d/struct.Vpeol3dSnapToPlane_search=std%3A%3Avec Documentation for the `TryFrom` and `TryInto` traits, covering fallible conversions between types. ```APIDOC ## TryFrom and TryInto Traits ### `impl TryFrom for T where U: Into` #### `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 where U: TryFrom` This trait provides fallible conversion from `T` to `U`. ``` -------------------------------- ### TryFrom Conversions Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/struct.YoleckPopulateContext_search=u32+-%3E+bool Documentation for the `TryFrom` trait, enabling fallible conversions between types. ```APIDOC ## TryFrom for T ### Description Allows for fallible conversion of a type `U` into type `T`. The conversion can fail, returning an `Error`. ### Associated Type - **Error** (`Infallible`) - The type returned in the event of a conversion error. ### Method `try_from(value: U) -> Result>::Error>` ### Endpoint N/A (Trait Implementation) ### Parameters - **value** (U) - Required - The value to attempt conversion from. ### Request Body None ### Response #### Success Response - **Result** (type) - A `Result` containing the converted value or an error. ### Response Example N/A (Trait Implementation) ``` -------------------------------- ### Iterator Reference Adapter Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/exclusive_systems/type.YoleckExclusiveSystem_search= Provides a way to get a mutable reference to the iterator itself. ```APIDOC ## Iterator Adapter: By Reference ### Description This method allows you to obtain a mutable reference to the iterator, which can be useful for certain advanced scenarios or when chaining methods that require mutable access to the iterator state. ### Method #### `by_ref(&mut self) -> &mut Self` Creates a “by reference” adapter for this instance of `Iterator`. This returns a mutable reference to the iterator itself. ### Request Example ```rust // Example usage of by_ref let mut data = vec![1, 2, 3]; let mut iter = data.iter_mut(); if let Some(first) = iter.by_ref().next() { println!("First element: {}", first); } // You can continue using the same iterator if let Some(second) = iter.next() { println!("Second element: {}", second); } ``` ### Response #### Success Response (200) - The `println!` statements will output: - `First element: 1` - `Second element: 2` ``` -------------------------------- ### System Scheduling Configurations (Rust) Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/vpeol/enum.VpeolSystems_search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Offers extensive configuration options for Bevy systems using `ScheduleConfigs`. Methods like `into_configs`, `in_set`, `before`, `after`, `run_if`, and `distributive_run_if` allow fine-grained control over system execution order, dependencies, and conditional execution, enabling complex game logic orchestration. ```rust fn into_configs(self) -> ScheduleConfigs> fn in_set(self, set: impl SystemSet) -> ScheduleConfigs fn before(self, set: impl IntoSystemSet) -> ScheduleConfigs fn after(self, set: impl IntoSystemSet) -> ScheduleConfigs fn before_ignore_deferred(self, set: impl IntoSystemSet) -> ScheduleConfigs fn after_ignore_deferred(self, set: impl IntoSystemSet) -> ScheduleConfigs fn distributive_run_if(self, condition: impl SystemCondition + Clone) -> ScheduleConfigs fn run_if(self, condition: impl SystemCondition) -> ScheduleConfigs ``` -------------------------------- ### Get Layout Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/struct.YoleckPanelUi_search=u32+-%3E+bool Retrieves the current layout information for the UI. ```APIDOC ## GET /ui/layout ### Description Retrieves the current layout configuration of the UI. ### Method GET ### Endpoint /ui/layout ### Response #### Success Response (200) - **layout** (object) - The current layout object. - **direction** (string) - The layout direction (e.g., "Horizontal", "Vertical"). - **align_items** (string) - Alignment of items along the cross axis. - **justify_content** (string) - Alignment of items along the main axis. #### Response Example ```json { "layout": { "direction": "Vertical", "align_items": "Center", "justify_content": "SpaceBetween" } } ``` ``` -------------------------------- ### BundleFromComponents Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/struct.YoleckSystemMarker Provides functionality to create bundles from components. ```APIDOC ## impl BundleFromComponents for C where C: Component, ### fn from_components(ctx: &mut T, func: &mut F) -> C where F: for<'a> FnMut(&'a mut T) -> OwningPtr<'a>, **Description** Creates a bundle from components using a provided context and function. **Method** `unsafe fn` **Endpoint** N/A (Implementation detail) **Parameters** #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) Returns the created bundle of type C. #### Response Example None ``` -------------------------------- ### Get Clip Rect Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckUi Retrieves the screen-space clipping rectangle for the UI. ```APIDOC ## GET /ui/clip_rect ### Description Returns the screen-space rectangle used for clipping rendered content within this UI context. This prevents drawing outside designated areas, such as a window smaller than its content. ### Method GET ### Endpoint /ui/clip_rect ### Parameters None ### Response #### Success Response (200) - **clip_rect** (object) - An object representing the clipping rectangle (e.g., `{"x": 0, "y": 0, "w": 800, "h": 600}`). #### Response Example ```json { "clip_rect": {"x": 0, "y": 0, "w": 800, "h": 600} } ``` ``` -------------------------------- ### DynamicBundle Implementation Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/struct.YoleckSystemMarker_search=std%3A%3Avec Facilitates the creation and application of bundles dynamically. ```APIDOC ## impl DynamicBundle for C ### Description Facilitates the creation and application of bundles dynamically. ### Associated Types #### `type Effect = ()` - **Description**: Represents an operation that occurs on an entity *after* this bundle is inserted. ### Methods #### `get_components(ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>)) -> ::Effect` - **Description**: Moves the components out of the bundle into the provided function. This is an unsafe operation. - **Parameters**: - `ptr` (MovingPtr<'_, C>): A moving pointer to the bundle. - `func` (&mut impl FnMut(StorageType, OwningPtr<'_>)): A mutable closure that receives the storage type and an owning pointer to the component. - **Returns**: `::Effect` - The effect associated with applying this bundle. #### `apply_effect(_ptr: MovingPtr<'_, MaybeUninit>, _entity: &mut EntityWorldMut<'_>)` - **Description**: Applies the after-effects of spawning this bundle. This is an unsafe operation. - **Parameters**: - `_ptr` (MovingPtr<'_, MaybeUninit>): A moving pointer to the uninitialized bundle data. - `_entity` (&mut EntityWorldMut<'_>): A mutable reference to the entity world. ``` -------------------------------- ### Get Layout Source: https://idanarye.github.io/bevy-yoleck/bevy_yoleck/prelude/struct.YoleckUi Retrieves the current layout information for the UI context. ```APIDOC ## GET /ui/layout ### Description Returns a reference to the current `Layout` object associated with the UI context, providing information about the arrangement and sizing of UI elements. ### Method GET ### Endpoint /ui/layout ### Parameters None ### Response #### Success Response (200) - **layout** (object) - An object representing the current layout configuration. #### Response Example ```json { "layout": { "direction": "Vertical", "cross_align": "Center", "main_align": "Start" } } ``` ```