### Using reply_ok! Macro Source: https://docs.rs/bevy_console/0.17.1/bevy_console/macro.reply_ok.html Example of how to use the reply_ok! macro to send a formatted message with arguments. ```rust reply_ok!(cmd, "Hello, {}", name); ``` -------------------------------- ### Example usage of the reply macro Source: https://docs.rs/bevy_console/0.17.1/bevy_console/macro.reply.html Demonstrates how to use the reply macro to send a formatted message with a variable. ```rust reply!(cmd, "Hello, {}", name); ``` -------------------------------- ### Deriving and Using ConsoleCommand Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsoleCommand.html This example demonstrates how to derive ConsoleCommand for a struct and use it within a function to process parsed commands. It shows how to take the command, check for success, and acknowledge it. ```rust /// Prints given arguments to the console. #[derive(Parser, ConsoleCommand)] #[command(name = "log")] struct LogCommand { /// Message to print msg: String, /// Number of times to print message num: Option, } fn log_command(mut log: ConsoleCommand) { if let Some(Ok(LogCommand { msg, num })) = log.take() { log.ok(); } } ``` -------------------------------- ### ConsolePlugin Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsolePlugin.html Represents the Console plugin for Bevy applications. It provides methods to configure the application's app, manage its readiness, finalize setup, and perform cleanup operations. ```APIDOC ## ConsolePlugin ### Description Console plugin. ### Methods #### `build(&self, app: &mut App)` Configures the `App` to which this plugin is added. #### `ready(&self, _app: &App) -> bool` Has the plugin finished its setup? This can be useful for plugins that need something asynchronous to happen before they can finish their setup, like the initialization of a renderer. Once the plugin is ready, `finish` should be called. #### `finish(&self, _app: &mut App)` Finish adding this plugin to the `App`, once all plugins registered are ready. This can be useful for plugins that depends on another plugin asynchronous setup, like the renderer. #### `cleanup(&self, _app: &mut App)` Runs after all plugins are built and finished, but before the app schedule is executed. This can be useful if you have some resource that other plugins need during their build step, but after build you want to remove it and send it to another thread. #### `name(&self) -> &str` Configures a name for the `Plugin` which is primarily used for checking plugin uniqueness and debugging. #### `is_unique(&self) -> bool` If the plugin can be meaningfully instantiated several times in an `App`, override this method to return `false`. ``` -------------------------------- ### Creating a Filtered Tracing Layer Source: https://docs.rs/bevy_console/0.17.1/bevy_console/fn.make_filtered_layer.html This example demonstrates how to use `make_filtered_layer` within Bevy's `LogPlugin` to capture logs based on a custom filter string. It configures the log level and specifies which messages (e.g., 'mygame=info,warn,debug,error') should be included in the console. ```rust DefaultPlugins.set(LogPlugin { filter: log::DEFAULT_FILTER.to_string(), level: log::Level::INFO, custom_layer: |app: &mut App| make_filtered_layer(app, "mygame=info,warn,debug,error".to_string()) }) ``` -------------------------------- ### Use reply_failed Macro Source: https://docs.rs/bevy_console/0.17.1/bevy_console/macro.reply_failed.html Example of using the reply_failed macro to send a formatted failure message with a variable. ```rust reply_failed!(cmd, "Hello, {}", name); ``` -------------------------------- ### type_id Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Gets the TypeId of the ConsoleSet instance. This is useful for runtime type identification. ```APIDOC ## fn type_id(&self) -> TypeId ### Description Gets the `TypeId` of `self`. ### Method GET ### Endpoint N/A (SDK method) ### Parameters None ### Response #### Success Response (200) - **TypeId** (TypeId) - The unique identifier for the type of the instance. ``` -------------------------------- ### IntoScheduleConfigs, ()> for S Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Methods for configuring system schedules, allowing for ordering, conditional execution, and grouping of systems. ```APIDOC ## fn into_configs(self) -> ScheduleConfigs> ### Description Convert into a `ScheduleConfigs`. ### Method N/A (Method on `self`) ### Parameters N/A ``` ```APIDOC ## fn in_set(self, set: impl SystemSet) -> ScheduleConfigs ### Description Add these systems to the provided `set`. ### Method N/A (Method on `self`) ### Parameters #### Query Parameters - **set** (impl SystemSet) - Required - The system set to add these systems to. ``` ```APIDOC ## fn before(self, set: impl IntoSystemSet) -> ScheduleConfigs ### 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 N/A (Method on `self`) ### Parameters #### Query Parameters - **set** (impl IntoSystemSet) - Required - The system set to run before. ``` ```APIDOC ## fn after(self, set: impl IntoSystemSet) -> ScheduleConfigs ### Description 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. ### Method N/A (Method on `self`) ### Parameters #### Query Parameters - **set** (impl IntoSystemSet) - Required - The system set to run after. ``` ```APIDOC ## fn before_ignore_deferred(self, set: impl IntoSystemSet) -> ScheduleConfigs ### Description Run before all systems in `set`. ### Method N/A (Method on `self`) ### Parameters #### Query Parameters - **set** (impl IntoSystemSet) - Required - The system set to run before, ignoring deferred operations. ``` ```APIDOC ## fn after_ignore_deferred(self, set: impl IntoSystemSet) -> ScheduleConfigs ### Description Run after all systems in `set`. ### Method N/A (Method on `self`) ### Parameters #### Query Parameters - **set** (impl IntoSystemSet) - Required - The system set to run after, ignoring deferred operations. ``` ```APIDOC ## fn distributive_run_if(self, condition: impl SystemCondition + Clone) -> ScheduleConfigs ### Description Add a run condition to each contained system. ### Method N/A (Method on `self`) ### Parameters #### Query Parameters - **condition** (impl SystemCondition + Clone) - Required - The system condition to apply. ``` ```APIDOC ## fn run_if(self, condition: impl SystemCondition) -> ScheduleConfigs ### Description Run the systems only if the `SystemCondition` is `true`. ### Method N/A (Method on `self`) ### Parameters #### Query Parameters - **condition** (impl SystemCondition) - Required - The system condition to check. ``` ```APIDOC ## fn ambiguous_with(self, set: impl IntoSystemSet) -> ScheduleConfigs ### Description Suppress warnings and errors that would result from these systems having ambiguities (conflicting access but indeterminate order) with systems in `set`. ### Method N/A (Method on `self`) ### Parameters #### Query Parameters - **set** (impl IntoSystemSet) - Required - The system set to check for ambiguities with. ``` ```APIDOC ## fn ambiguous_with_all(self) -> ScheduleConfigs ### Description Suppress warnings and errors that would result from these systems having ambiguities (conflicting access but indeterminate order) with any other system. ### Method N/A (Method on `self`) ### Parameters N/A ``` ```APIDOC ## fn chain(self) -> ScheduleConfigs ### Description Treat this collection as a sequence of systems. ### Method N/A (Method on `self`) ### Parameters N/A ``` ```APIDOC ## fn chain_ignore_deferred(self) -> ScheduleConfigs ### Description Treat this collection as a sequence of systems. ### Method N/A (Method on `self`) ### Parameters N/A ``` -------------------------------- ### as_any Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Provides a reference to the ConsoleSet instance as a reference to Any. ```APIDOC ## fn as_any(&self) -> &(dyn Any + 'static) ### Description Converts `&Trait` (where `Trait: Downcast`) to `&Any`. This is needed since Rust cannot generate `&Any`’s vtable from `&Trait`’s. ### Method GET ### Endpoint N/A (SDK method) ### Parameters None ### Response #### Success Response (200) - **&(dyn Any + 'static)** (&(dyn Any + 'static)) - A reference to the ConsoleSet instance as Any. ``` -------------------------------- ### into_any Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Converts a boxed ConsoleSet instance into a Box. ```APIDOC ## fn into_any(self: Box) -> Box ### Description Converts `Box` (where `Trait: Downcast`) to `Box`, which can then be `downcast` into `Box` where `ConcreteType` implements `Trait`. ### Method POST ### Endpoint N/A (SDK method) ### Parameters - **self** (Box) - The boxed ConsoleSet instance. ### Response #### Success Response (200) - **Box** (Box) - A boxed trait object of type Any. ``` -------------------------------- ### from Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Creates a ConsoleSet instance from a given value. ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. ### Method POST ### Endpoint N/A (SDK method) ### Parameters - **t** (T) - The value to convert. ### Response #### Success Response (200) - **T** (T) - The ConsoleSet instance. ``` -------------------------------- ### equivalent Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Compares the ConsoleSet instance to a key for equivalence. ```APIDOC ## fn equivalent(&self, key: &K) -> bool ### Description Compare self to `key` and return `true` if they are equal. ### Method GET ### Endpoint N/A (SDK method) ### Parameters - **key** (&K) - The key to compare against. ### Response #### Success Response (200) - **bool** (bool) - True if the instances are equivalent, false otherwise. ``` -------------------------------- ### Create New Console Line Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.PrintConsoleLine.html Constructs a new PrintConsoleLine instance with the provided text. ```rust pub const fn new(line: String) -> Self ``` -------------------------------- ### Create and Add a Console Command Source: https://docs.rs/bevy_console/0.17.1/bevy_console/index.html Define a command struct using `clap::Parser` and derive `ConsoleCommand`. Add the command to your app using `.add_console_command`. Doc comments on the struct provide help text. ```rust use bevy::prelude::*; use bevy_console::{reply, AddConsoleCommand, ConsoleCommand, ConsolePlugin}; use clap::Parser; fn main() { App::new() .add_plugins((DefaultPlugins, ConsolePlugin)) .add_console_command::(example_command); } /// Example command #[derive(Parser, ConsoleCommand)] #[command(name = "example")] struct ExampleCommand { /// Some message msg: String, } fn example_command(mut log: ConsoleCommand) { if let Some(Ok(ExampleCommand { msg })) = log.take() { // handle command } } ``` -------------------------------- ### into_any_rc Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Converts an Rc instance into an Rc. ```APIDOC ## fn into_any_rc(self: Rc) -> Rc ### Description Converts `Rc` (where `Trait: Downcast`) to `Rc`, which can then be further `downcast` into `Rc` where `ConcreteType` implements `Trait`. ### Method POST ### Endpoint N/A (SDK method) ### Parameters - **self** (Rc) - The Rc-wrapped ConsoleSet instance. ### Response #### Success Response (200) - **Rc** (Rc) - An Rc-wrapped trait object of type Any. ``` -------------------------------- ### into_any_send Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Converts a boxed ConsoleSet instance into a Box. ```APIDOC ## fn into_any_send(self: Box) -> Box ### Description Converts `Box` (where `Trait: DowncastSend`) to `Box`, which can then be `downcast` into `Box` where `ConcreteType` implements `Trait`. ### Method POST ### Endpoint N/A (SDK method) ### Parameters - **self** (Box) - The boxed ConsoleSet instance. ### Response #### Success Response (200) - **Box** (Box) - A boxed trait object of type Any + Send. ``` -------------------------------- ### Pointable Methods Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsoleOpen.html Provides methods for managing and interacting with pointers, including initialization, dereferencing, and dropping. ```APIDOC ## Pointable Methods ### Description Provides methods for managing and interacting with pointers, including initialization, dereferencing, and dropping. ### Associated Types * `Init`: The type for initializers. ### Associated Constants * `ALIGN`: The alignment of the pointer (usize). ### Methods #### unsafe fn init(init: ::Init) -> usize Initializes an object with the given initializer and returns its pointer. #### unsafe fn deref<'a>(ptr: usize) -> &'a T Dereferences the given pointer to provide an immutable reference to the object. #### unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T Mutably dereferences the given pointer to provide a mutable reference to the object. #### unsafe fn drop(ptr: usize) Drops the object pointed to by the given pointer. ``` -------------------------------- ### FromWorld Implementation for ConsoleOpen Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsoleOpen.html Implements FromWorld, allowing ConsoleOpen to be constructed directly from the Bevy world. It uses the default implementation, setting 'open' to false. ```rust fn from_world(_world: &mut World) -> T ``` -------------------------------- ### impl Settings for T Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.BevyLogBuffer.html Provides settings for types that are static, sendable, and syncable. ```APIDOC ## impl Settings for T ### Description Provides settings for types that are static, sendable, and syncable. ### Traits #### `where T: 'static + Send + Sync` ``` -------------------------------- ### clone_to_uninit Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Performs copy-assignment from the ConsoleSet instance to an uninitialized memory location. This is an experimental nightly-only API. ```APIDOC ## unsafe fn clone_to_uninit(&self, dest: *mut u8) ### Description 🔬This is a nightly-only experimental API. (`clone_to_uninit`) Performs copy-assignment from `self` to `dest`. ### Method POST ### Endpoint N/A (SDK method) ### Parameters - **dest** (*mut u8) - A mutable pointer to the destination memory location. ### Response None (operation is unsafe and modifies memory directly). ``` -------------------------------- ### Add ConsolePlugin and ConsoleConfiguration Source: https://docs.rs/bevy_console/0.17.1/bevy_console/index.html To use the Bevy Console, add `ConsolePlugin` to your Bevy app. You can optionally insert `ConsoleConfiguration` to override default settings. ```rust use bevy::prelude::*; use bevy_console::{ConsoleConfiguration, ConsolePlugin}; fn main() { App::new() .add_plugins((DefaultPlugins, ConsolePlugin)) .insert_resource(ConsoleConfiguration { // override config here ..Default::default() }); } ``` -------------------------------- ### Create Bevy Tracing Layer Source: https://docs.rs/bevy_console/0.17.1/bevy_console/fn.make_layer.html Use this function to create a tracing layer that logs events into a Bevy buffer resource. This is the default method for the console plugin. For custom filtering, consider `make_filtered_layer`. ```rust pub fn make_layer( app: &mut App, ) -> Option + Send + Sync>> ``` -------------------------------- ### IntoSystemSet<()> for S Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Provides a method to convert an instance into its associated `SystemSet` type. ```APIDOC ## fn into_system_set(self) -> >::Set ### Description Converts this instance to its associated `SystemSet` type. ### Method N/A (Method on `self`) ### Parameters N/A ``` -------------------------------- ### into Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Converts the ConsoleSet instance into another type U that implements From. ```APIDOC ## fn into(self) -> U ### Description Calls `U::from(self)`. That is, this conversion is whatever the implementation of `From for U` chooses to do. ### Method POST ### Endpoint N/A (SDK method) ### Parameters None ### Response #### Success Response (200) - **U** (U) - The converted value of type U. ``` -------------------------------- ### Add Console Command to Bevy App Source: https://docs.rs/bevy_console/0.17.1/bevy_console/trait.AddConsoleCommand.html Use this method to register a new console command with its associated system. This allows the command to be recognized by the console and listed in the 'help' command output. ```rust App::new() .add_console_command::(log_command); ``` -------------------------------- ### PrintConsoleLine::new Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.PrintConsoleLine.html Creates a new console line to print. This is a constructor for the PrintConsoleLine struct. ```APIDOC ## PrintConsoleLine::new ### Description Creates a new console line to print. ### Method `new` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```rust let console_line = PrintConsoleLine::new("Hello, console!".to_string()); ``` ### Response #### Success Response - **Self** (PrintConsoleLine) - A new instance of PrintConsoleLine. #### Response Example ```rust // Example of a PrintConsoleLine instance // PrintConsoleLine { line: "Hello, console!".to_string() } ``` ``` -------------------------------- ### into_either Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Converts the ConsoleSet instance into an Either variant. ```APIDOC ## fn into_either(self, into_left: bool) -> Either ### Description Converts `self` into a `Left` variant of `Either` if `into_left` is `true`. Converts `self` into a `Right` variant of `Either` otherwise. ### Method POST ### Endpoint N/A (SDK method) ### Parameters - **into_left** (bool) - If true, convert to Left; otherwise, convert to Right. ### Response #### Success Response (200) - **Either** (Either) - The Either variant containing the ConsoleSet instance. ``` -------------------------------- ### Resource Implementation for ConsoleOpen Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsoleOpen.html Marks ConsoleOpen as a Bevy resource, enabling it to be managed and accessed within the Bevy ECS. Requires Send and Sync traits for multi-threaded access. ```rust impl Resource for ConsoleOpen where Self: Send + Sync + 'static, ``` -------------------------------- ### Plugins Implementation Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsolePlugin.html Implementation for the `Plugins` trait, allowing for plugin management. ```APIDOC ## impl Plugins for T ### Description Implementation for the `Plugins` trait, allowing for plugin management. ### Constraints `T: Plugins` ``` -------------------------------- ### into_either_with Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Converts the ConsoleSet instance into an Either variant based on a predicate. ```APIDOC ## fn into_either_with(self, into_left: F) -> Either where F: FnOnce(&Self) -> bool, ### Description Converts `self` into a `Left` variant of `Either` if `into_left(&self)` returns `true`. Converts `self` into a `Right` variant of `Either` otherwise. ### Method POST ### Endpoint N/A (SDK method) ### Parameters - **into_left** (F: FnOnce(&Self) -> bool) - A closure that returns true to convert to Left, false for Right. ### Response #### Success Response (200) - **Either** (Either) - The Either variant containing the ConsoleSet instance. ``` -------------------------------- ### instrument Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Instruments the ConsoleSet instance with a provided Span. ```APIDOC ## fn instrument(self, span: Span) -> Instrumented ### Description Instruments this type with the provided `Span`, returning an `Instrumented` wrapper. ### Method POST ### Endpoint N/A (SDK method) ### Parameters - **span** (Span) - The span to instrument with. ### Response #### Success Response (200) - **Instrumented** (Instrumented) - An Instrumented wrapper around the ConsoleSet instance. ``` -------------------------------- ### TryFrom Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsoleConfiguration.html Enables fallible conversion from one type to another, returning a Result. ```APIDOC ## type Error = Infallible ### Description The type returned in the event of a conversion error. ### Method N/A (Associated type on a trait) ### Parameters N/A ``` ```APIDOC ## fn try_from(value: U) -> Result>::Error> ### Description Performs the conversion. ### Method N/A (Method on a trait implementation) ### Parameters - **value**: The value to convert. ``` -------------------------------- ### TryInto Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsoleConfiguration.html Enables fallible conversion into another type, returning a Result. ```APIDOC ## type Error = >::Error ### Description The type returned in the event of a conversion error. ### Method N/A (Associated type on a trait) ### Parameters N/A ``` ```APIDOC ## fn try_into(self) -> Result>::Error> ### Description Performs the conversion. ### Method N/A (Method on a trait implementation) ### Parameters - **self**: The value to convert. ``` -------------------------------- ### try_from Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.PrintConsoleLine.html Attempts to perform a conversion from one type to another, returning a Result. ```APIDOC ## fn try_from(value: U) -> Result>::Error> ### Description Performs the conversion from type U to type T. ### Method try_from ### Parameters - **value** (U) - The value to convert. ``` -------------------------------- ### reply_ok! Macro Definition Source: https://docs.rs/bevy_console/0.17.1/bevy_console/macro.reply_ok.html Defines the syntax for the reply_ok macro, which accepts a command identifier, a format string, and optional arguments. ```rust macro_rules! reply_ok { ($cmd: ident, $fmt: literal$(, $($arg:expr),* $(,)?)?) => { ... }; } ``` -------------------------------- ### impl SystemParam for ConsoleCommand<'_, T> Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsoleCommand.html Implementation of the SystemParam trait for ConsoleCommand, enabling its use within Bevy systems. ```APIDOC ## impl SystemParam for ConsoleCommand<'_, T> ### Description This block details the implementation of the `SystemParam` trait for `ConsoleCommand`. This allows `ConsoleCommand` to be used as a parameter within Bevy systems, enabling systems to interact with console commands. ### Associated Types #### type State = ConsoleCommandState *Description*: Used to store data which persists across invocations of a system. #### type Item<'w, 's> = ConsoleCommand<'w, T> *Description*: The item type returned when constructing this system param. The value of this associated type should be `Self`, instantiated with new lifetimes. ### Methods #### fn init_state(world: &mut World) -> Self::State *Description*: Creates a new instance of this param’s `State`. #### fn init_access( _state: &Self::State, _system_meta: &mut SystemMeta, _component_access_set: &mut FilteredAccessSet, _world: &mut World, ) *Description*: Registers any `World` access used by this `SystemParam`. #### unsafe fn get_param<'w, 's>( state: &'s mut Self::State, system_meta: &SystemMeta, world: UnsafeWorldCell<'w>, change_tick: Tick, ) -> Self::Item<'w, 's> *Description*: Creates a parameter to be passed into a `SystemParamFunction`. #### fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World) *Description*: Applies any deferred mutations stored in this `SystemParam`’s state. This is used to apply `Commands` during `ApplyDeferred`. #### fn queue( state: &mut Self::State, system_meta: &SystemMeta, world: DeferredWorld<'_>, ) *Description*: Queues any deferred mutations to be applied at the next `ApplyDeferred`. #### unsafe fn validate_param( state: &mut Self::State, system_meta: &SystemMeta, world: UnsafeWorldCell<'_>, ) -> Result<(), SystemParamValidationError> *Description*: Validates that the param can be acquired by the `get_param`. ``` -------------------------------- ### borrow Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Provides an immutable borrow to the ConsoleSet instance. ```APIDOC ## fn borrow(&self) -> &T ### Description Immutably borrows from an owned value. ### Method GET ### Endpoint N/A (SDK method) ### Parameters None ### Response #### Success Response (200) - **&T** (&T) - An immutable reference to the ConsoleSet instance. ``` -------------------------------- ### Write Implementation for BevyLogBufferWriter Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.BevyLogBufferWriter.html Shows the implementation of the standard Write trait for BevyLogBufferWriter, enabling it to be used for writing data. ```rust fn write(&mut self, buf: &[u8]) -> Result ``` ```rust fn flush(&mut self) -> Result<()> ``` ```rust fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result ``` ```rust fn is_write_vectored(&self) -> bool ``` ```rust fn write_all(&mut self, buf: &[u8]) -> Result<(), Error> ``` ```rust fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error> ``` ```rust fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error> ``` ```rust fn by_ref(&mut self) -> &mut Self where Self: Sized, ``` -------------------------------- ### Settings Implementation Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsolePlugin.html Implementation for the `Settings` trait, indicating a type has associated settings. ```APIDOC ## impl Settings for T ### Description Implementation for the `Settings` trait, indicating a type has associated settings. ### Constraints `T: 'static + Send + Sync` ``` -------------------------------- ### to_owned and clone_into Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.PrintConsoleLine.html Methods for creating owned data from borrowed data. ```APIDOC ## fn to_owned(&self) -> T ### Description Creates owned data from borrowed data, usually by cloning. ### Method to_owned ### Parameters - **&self** (T) - The borrowed data. ## fn clone_into(&self, target: &mut T) ### Description Uses borrowed data to replace owned data, usually by cloning. ### Method clone_into ### Parameters - **&self** (T) - The borrowed data. - **target** (&mut T) - The mutable reference to the owned data to be replaced. ``` -------------------------------- ### Default Implementation for ConsoleOpen Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsoleOpen.html Provides a default value for ConsoleOpen, initializing the console to a closed state (open: false). ```rust fn default() -> ConsoleOpen ``` -------------------------------- ### dyn_hash Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Feeds the ConsoleSet instance into a Hasher. ```APIDOC ## fn dyn_hash(&self, state: &mut dyn Hasher) ### Description Feeds this value into the given `Hasher`. ### Method POST ### Endpoint N/A (SDK method) ### Parameters - **state** (&mut dyn Hasher) - The mutable hasher state. ### Response None (operation modifies hasher state). ``` -------------------------------- ### TryFrom and TryInto Conversions Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.BevyLogBufferWriter.html Enables fallible conversions between types using `TryFrom` and `TryInto` traits. ```APIDOC ## TryFrom and TryInto Conversions ### `TryFrom` for `T` - **`try_from(value: U) -> Result`**: Attempts to convert a value of type `U` into type `T`. - **`type Error`**: The error type returned when the conversion fails. ``` ```APIDOC ### `TryInto` for `T` - **`try_into(self) -> Result`**: Attempts to convert `self` into type `U`. - **`type Error`**: The error type returned when the conversion fails. ``` -------------------------------- ### WithSubscriber Methods Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.BevyLogBufferWriter.html Allows attaching subscribers to types, enabling custom event handling. ```APIDOC ## WithSubscriber Trait ### Methods - **`with_subscriber(self, subscriber: S) -> WithDispatch`**: Attaches a provided subscriber to the type. - **`with_current_subscriber(self) -> WithDispatch`**: Attaches the current default subscriber to the type. ``` -------------------------------- ### BevyLogBufferWriter Write Implementation Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.BevyLogBufferWriter.html Provides methods for writing data to the BevyLogBufferWriter. These methods are part of the standard Write trait. ```APIDOC ## fn write(&mut self, buf: &[u8]) -> Result ### Description Writes a buffer into this writer, returning how many bytes were written. ### Method `write` ### Parameters #### Path Parameters - `buf` ( &[u8] ) - Required - The byte slice to write. ``` ```APIDOC ## fn flush(&mut self) -> Result<()> ### Description Flushes this output stream, ensuring that all intermediately buffered contents reach their destination. ### Method `flush` ``` ```APIDOC ## fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result ### Description Like `write`, except that it writes from a slice of buffers. ### Method `write_vectored` ### Parameters #### Path Parameters - `bufs` ( &[IoSlice<'_>] ) - Required - A slice of I/O slices to write from. ``` ```APIDOC ## fn is_write_vectored(&self) -> bool ### Description Determines if this `Write`r has an efficient `write_vectored` implementation. ### Method `is_write_vectored` ``` ```APIDOC ## fn write_all(&mut self, buf: &[u8]) -> Result<(), Error> ### Description Attempts to write an entire buffer into this writer. ### Method `write_all` ### Parameters #### Path Parameters - `buf` ( &[u8] ) - Required - The byte slice to write. ``` ```APIDOC ## fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error> ### Description Attempts to write multiple buffers into this writer. ### Method `write_all_vectored` ### Parameters #### Path Parameters - `bufs` ( &mut [IoSlice<'_>] ) - Required - A mutable slice of I/O slices to write from. ``` ```APIDOC ## fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error> ### Description Writes a formatted string into this writer, returning any error encountered. ### Method `write_fmt` ### Parameters #### Path Parameters - `args` ( Arguments<'_> ) - Required - The formatted arguments to write. ``` ```APIDOC ## fn by_ref(&mut self) -> &mut Self ### Description Creates a “by reference” adapter for this instance of `Write`. ### Method `by_ref` ``` -------------------------------- ### Pointable Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsoleConfiguration.html Defines operations for managing pointers to types, including initialization, dereferencing, and dropping. ```APIDOC ## const ALIGN: usize ### Description The alignment of the pointer. ### Method N/A (Associated constant on a trait) ### Parameters N/A ``` ```APIDOC ## type Init = T ### Description The type for initializers. ### Method N/A (Associated type on a trait) ### Parameters N/A ``` ```APIDOC ## unsafe fn init(init: ::Init) -> usize ### Description Initializes a with the given initializer. ### Method N/A (Method on a trait implementation) ### Parameters - **init**: The initializer for the type. ``` ```APIDOC ## unsafe fn deref<'a>(ptr: usize) -> &'a T ### Description Dereferences the given pointer. ### Method N/A (Method on a trait implementation) ### Parameters - **ptr**: The pointer to dereference. ``` ```APIDOC ## unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T ### Description Mutably dereferences the given pointer. ### Method N/A (Method on a trait implementation) ### Parameters - **ptr**: The pointer to mutably dereference. ``` ```APIDOC ## unsafe fn drop(ptr: usize) ### Description Drops the object pointed to by the given pointer. ### Method N/A (Method on a trait implementation) ### Parameters - **ptr**: The pointer to the object to drop. ``` -------------------------------- ### name() Method Signature Source: https://docs.rs/bevy_console/0.17.1/bevy_console/trait.NamedCommand.html The `name()` method returns the unique command identifier, which is the same as the command's 'executable' name. ```rust fn name() -> &'static str; ``` -------------------------------- ### Any Trait Implementation Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsoleOpen.html Implements the Any trait, allowing ConsoleOpen instances to be treated as any type at runtime. This is part of Bevy's internal type system for systems and resources. ```rust fn type_id(&self) -> TypeId ``` -------------------------------- ### Define the reply macro Source: https://docs.rs/bevy_console/0.17.1/bevy_console/macro.reply.html This is the definition of the reply macro, which takes a command identifier, a format string, and optional arguments. ```rust macro_rules! reply { ($cmd: ident, $fmt: literal$(, $($arg:expr),* $(,)?)?) => { ... }; } ``` -------------------------------- ### WithSubscriber Implementation Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsolePlugin.html Allows attaching a subscriber to a type, returning a `WithDispatch` wrapper. ```APIDOC ## impl WithSubscriber for T ### Description Allows attaching a subscriber to a type, returning a `WithDispatch` wrapper. ### Methods #### fn with_subscriber(self, subscriber: S) -> WithDispatch where S: Into Attaches the provided `Subscriber` to this type, returning a `WithDispatch` wrapper. #### fn with_current_subscriber(self) -> WithDispatch Attaches the current default `Subscriber` to this type, returning a `WithDispatch` wrapper. ``` -------------------------------- ### impl Pointable for T Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.BevyLogBuffer.html Provides methods for managing and accessing data through raw pointers, including initialization, dereferencing, and dropping. ```APIDOC ## impl Pointable for T ### Description Provides methods for managing and accessing data through raw pointers, including initialization, dereferencing, and dropping. ### Methods #### `init(init: ::Init) -> usize` Initializes a with the given initializer. #### `deref<'a>(ptr: usize) -> &'a T` Dereferences the given pointer. #### `deref_mut<'a>(ptr: usize) -> &'a mut T` Mutably dereferences the given pointer. #### `drop(ptr: usize)` Drops the object pointed to by the given pointer. ### Associated Types #### `ALIGN: usize` The alignment of pointer. #### `Init = T` The type for initializers. ``` -------------------------------- ### as_any_mut Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Provides a mutable reference to the ConsoleSet instance as a mutable reference to Any. ```APIDOC ## fn as_any_mut(&mut self) -> &mut (dyn Any + 'static) ### 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 N/A (SDK method) ### Parameters None ### Response #### Success Response (200) - **&mut (dyn Any + 'static)** (&mut (dyn Any + 'static)) - A mutable reference to the ConsoleSet instance as Any. ``` -------------------------------- ### ConsoleCommand Methods Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsoleCommand.html Provides methods to interact with executed console commands, check their status, and send replies to the console. ```APIDOC ## ConsoleCommand ### Description Represents an executed parsed console command. It is used to capture commands that implement `CommandName`, `CommandArgs`, and `CommandHelp`, which can be easily implemented using the `ConsoleCommand` derive macro. ### Methods #### `take(&mut self) -> Option>` Returns `Some(T)` if the command was executed and arguments were valid. This method should only be called once; consecutive calls will return `None`. #### `ok(&mut self)` Prints `[ok]` to the console. #### `failed(&mut self)` Prints `[failed]` to the console. #### `reply(&mut self, msg: impl Into)` Prints a reply message to the console. Supports `format!` syntax via the `reply!` macro. #### `reply_ok(&mut self, msg: impl Into)` Prints a reply message to the console followed by `[ok]`. Supports `format!` syntax via the `reply_ok!` macro. #### `reply_failed(&mut self, msg: impl Into)` Prints a reply message to the console followed by `[failed]`. Supports `format!` syntax via the `reply_failed!` macro. ``` -------------------------------- ### in_current_span Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Instruments the ConsoleSet instance with the current Span. ```APIDOC ## fn in_current_span(self) -> Instrumented ### Description Instruments this type with the current `Span`, returning an `Instrumented` wrapper. ### Method POST ### Endpoint N/A (SDK method) ### Parameters None ### Response #### Success Response (200) - **Instrumented** (Instrumented) - An Instrumented wrapper around the ConsoleSet instance. ``` -------------------------------- ### make_filtered_layer Source: https://docs.rs/bevy_console/0.17.1/bevy_console/fn.make_filtered_layer.html Creates a tracing layer that writes logs into a buffer resource within the Bevy world. It uses a custom EnvFilter string to capture a specific subset of log entries for the console. ```APIDOC ## Function make_filtered_layer ### Description Creates a tracing layer which writes logs into a buffer resource inside the bevy world. Uses a custom EnvFilter string, allowing for a different subset of log entries to be captured by the console. This is used by the console plugin to capture logs written by bevy. ### Signature ```rust pub fn make_filtered_layer( app: &mut App, filter: String, ) -> Option + Send + Sync>> ``` ### Parameters * `app` - A mutable reference to the Bevy `App`. * `filter` - A `String` representing the custom `EnvFilter` to apply for log filtering. ### Returns An `Option` containing a boxed dynamic `Layer` if successful, otherwise `None`. ### Example ```rust DefaultPlugins.set(LogPlugin { filter: log::DEFAULT_FILTER.to_string(), level: log::Level::INFO, custom_layer: |app: &mut App| make_filtered_layer(app, "mygame=info,warn,debug,error".to_string()) }) ``` ``` -------------------------------- ### Pointable Trait Methods Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.BevyLogBufferWriter.html Provides methods for managing pointers to data, including initialization, dereferencing, and dropping. ```APIDOC ## Pointable Trait ### Methods - **`init(init: T::Init) -> usize`**: Initializes an object with the given initializer and returns a pointer to it. - **`deref<'a>(ptr: usize) -> &'a T`**: Dereferences a raw pointer to get an immutable reference to the object. - **`deref_mut<'a>(ptr: usize) -> &'a mut T`**: Dereferences a raw pointer to get a mutable reference to the object. - **`drop(ptr: usize)`**: Drops the object pointed to by the given pointer. ``` -------------------------------- ### TryFrom Implementation Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.ConsolePlugin.html Provides the `try_from` method for converting between types where `U` can be converted into `T`. ```APIDOC ## impl TryFrom for T ### Description Provides the `try_from` method for converting between types where `U` can be converted into `T`. ### Type Alias #### Error `Infallible` - The type returned in the event of a conversion error. ### Method #### fn try_from(value: U) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### add_console_command Source: https://docs.rs/bevy_console/0.17.1/bevy_console/trait.AddConsoleCommand.html Adds a console command to the Bevy app. This registers the command so it can be invoked and will be listed by the built-in 'help' console command. ```APIDOC ## add_console_command ### Description Adds a console command with a given system. This registers the console command so it will print with the built-in `help` console command. ### Method Signature `fn add_console_command(&mut self, system: impl IntoScheduleConfigs) -> &mut Self` ### Parameters * `system`: A system that implements `IntoScheduleConfigs`. ### Returns Returns a mutable reference to `Self` to allow for chaining. ### Example ```rust App::new() .add_console_command::(log_command); ``` ``` -------------------------------- ### into_result Source: https://docs.rs/bevy_console/0.17.1/bevy_console/struct.PrintConsoleLine.html Converts the type into the system's run system error output type. ```APIDOC ## fn into_result(self) -> Result, pub left_pos: f32, pub top_pos: f32, pub height: f32, pub width: f32, pub commands: BTreeMap<&'static str, Command>, pub history_size: usize, pub symbol: String, pub collapsible: bool, pub title_name: String, pub resizable: bool, pub moveable: bool, pub show_title_bar: bool, pub background_color: Color32, pub foreground_color: Color32, pub num_suggestions: usize, pub block_mouse: bool, pub block_keyboard: bool, pub arg_completions: Vec>, } ``` -------------------------------- ### make_layer Function Signature Source: https://docs.rs/bevy_console/0.17.1/bevy_console/fn.make_layer.html Creates a tracing layer that writes logs into a buffer resource inside the bevy world. This is used by the console plugin to capture logs written by bevy. Use make_filtered_layer for more customization options. ```APIDOC ## Function make_layer ### Description Creates a tracing layer which writes logs into a buffer resource inside the bevy world. This is used by the console plugin to capture logs written by bevy. Use `make_filtered_layer` for more customization options. ### Signature ```rust pub fn make_layer( app: &mut App, ) -> Option + Send + Sync>> ``` ### Parameters #### Path Parameters - **app** (*&mut App*) - A mutable reference to the Bevy application. ### Returns - **Option + Send + Sync>>** - An `Option` containing a boxed dynamic `Layer` if successful, otherwise `None`. ``` -------------------------------- ### WITNESS Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html A constant representing the type witness for ConsoleSet. ```APIDOC ## const WITNESS: W = W::MAKE ### Description A constant of the type witness. ### Method GET ### Endpoint N/A (SDK method) ### Parameters None ### Response #### Success Response (200) - **W** (W) - The type witness constant. ``` -------------------------------- ### Pointable for T Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Provides methods for pointer manipulation, including initialization, dereferencing, and dropping of objects. ```APIDOC ## const ALIGN: usize ### Description The alignment of pointer. ### Method N/A (Constant) ### Parameters N/A ``` ```APIDOC ## type Init = T ### Description The type for initializers. ### Method N/A (Type alias) ### Parameters N/A ``` ```APIDOC ## unsafe fn init(init: ::Init) -> usize ### Description Initializes a with the given initializer. ### Method N/A (Unsafe method) ### Parameters #### Request Body - **init** (::Init) - Required - The initializer for the object. ``` ```APIDOC ## unsafe fn deref<'a>(ptr: usize) -> &'a T ### Description Dereferences the given pointer. ### Method N/A (Unsafe method) ### Parameters #### Path Parameters - **ptr** (usize) - Required - The pointer to dereference. ``` ```APIDOC ## unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T ### Description Mutably dereferences the given pointer. ### Method N/A (Unsafe method) ### Parameters #### Path Parameters - **ptr** (usize) - Required - The pointer to mutably dereference. ``` ```APIDOC ## unsafe fn drop(ptr: usize) ### Description Drops the object pointed to by the given pointer. ### Method N/A (Unsafe method) ### Parameters #### Path Parameters - **ptr** (usize) - Required - The pointer to the object to drop. ``` -------------------------------- ### TryFrom for T Source: https://docs.rs/bevy_console/0.17.1/bevy_console/enum.ConsoleSet.html Provides a method for attempting to convert one type into another, returning a `Result`. ```APIDOC ## type Error = Infallible ### Description The type returned in the event of a conversion error. ### Method N/A (Type alias) ### Parameters N/A ``` ```APIDOC ## fn try_from(value: U) -> Result>::Error> ### Description Performs the conversion. ### Method N/A (Static method) ### Parameters #### Request Body - **value** (U) - Required - The value to convert. ```