Module ambient_api_core::prelude
source · Expand description
Helpful imports that almost all Ambient packages will use.
Re-exports
pub use crate::asset;
pub use crate::camera;
pub use crate::ecs::change_query;
pub use crate::ecs::despawn_query;
pub use crate::ecs::query;
pub use crate::ecs::spawn_query;
pub use crate::ecs::Component;
pub use crate::ecs::ComponentsTuple;
pub use crate::ecs::Concept;
pub use crate::ecs::ConceptComponents;
pub use crate::ecs::ConceptQuery;
pub use crate::ecs::ConceptSuggested;
pub use crate::ecs::Entity;
pub use crate::ecs::QueryEvent;
pub use crate::entity;
pub use crate::message;
pub use crate::message::ModuleMessage;
pub use crate::message::RuntimeMessage;
pub use crate::player;
pub use crate::global::*;
Modules
- audio
client
[Client-only] Audio functionality, including loading sounds and playback. - http
server
[Server-only] HTTP-related functionality, including sending requests and receiving responses. - input
client
[Client-only] Input retrieval and manipulation. - physics
server
[Server-only] Physics-related functionality, including applying forces, changing physical properties, and more.
Macros
- Construct an ad-hoc error from a string or existing non-
anyhow
error value.
Structs
- The standard RNG. The PRNG algorithm in
StdRng
is chosen to be efficient on the current platform, to be statistically strong and unpredictable (meaning a cryptographically secure PRNG). - A reference to the thread-local generator
Enums
- KeyCode
client
The code associated with a key on the keyboard. - MouseButton
client
Traits
- Provides the
context
method forResult
. - A marker trait used to indicate that an
RngCore
orBlockRngCore
implementation is supposed to be cryptographically secure. - Types (distributions) that can be used to create a random instance of
T
. - Extension trait on iterators, providing random sampling methods.
- Implemented on all types that can be de/serialized from/to a
Vec<u8>
. - An automatically-implemented extension trait on
RngCore
providing high-level generic methods for sampling values and other convenience methods. - The core of a random number generator.
- A random number generator that can be explicitly seeded.
- Extension trait on slices, providing random mutation and sampling methods.
Functions
- random
std
andstd_rng
Generates a random value using the thread-local random number generator. - Retrieve the lazily-initialized thread-local random number generator, seeded by the system. Intended to be used in method chaining style, e.g.
thread_rng().gen::<i32>()
, or cached locally, e.g.let mut rng = thread_rng();
. Invoked by theDefault
trait, makingThreadRng::default()
equivalent.
Attribute Macros
- Makes your
main()
function accessible to the WASM host, and generates apackages
module that contain all packages visible to your package, including itself.