Expand description
Core storage primitives and runtime registries for PyBevy
This crate provides the foundational types for PyBevy’s owned/borrowed pattern and the runtime type registry system that enables crate splitting.
§Storage Primitives
ValidityFlag/ValidityFlagWithMode- Runtime validity trackingValidityGuard- RAII guard for system execution scopeValueStorage<T>- Generic storage for Copy types (Vec3, Quat, etc.)FieldStorage<T>- Generic storage for non-Copy types (TextureAtlas, etc.)BorrowableStorage/FromBorrowedStorage- Traits for borrowed field access
§Runtime Registries
ComponentBridge- Trait for component type bridgesAssetBridge- Trait for asset type bridgesPluginBridge- Trait for plugin type bridgesDynamicComponentRegistry- Runtime registry for component bridgesDynamicAssetRegistry- Runtime registry for asset bridges
The registry system allows feature crates (pybevy_audio, pybevy_light, etc.) to register their types without the core crate needing to import them at compile time, enabling independent compilation and faster incremental builds.
Re-exports§
pub use asset::NativeAsset;pub use asset::PyAsset;pub use asset_path::PyAssetPath;pub use component::PyComponent;pub use debug_snapshot::DebugSnapshot;pub use debug_snapshot::ReloadMemorySnapshotInfo;pub use entity::PyEntity;pub use handle::PyHandle;pub use handle::extract_handle_from_any;pub use hierarchy::PyChildOf;pub use hierarchy::PyChildren;pub use hierarchy::PyChildrenIterator;pub use materializable::PyMaterializable;pub use message::PyMessage;pub use message::PyMessageId;pub use plugin::PluginBridge;pub use plugin::PyPlugin;pub use registry::AssetBridge;pub use registry::BatchComponent;pub use registry::BatchFieldMeta;pub use registry::BatchableField;pub use registry::ComponentBatchInsertFn;pub use registry::ComponentBatchMeta;pub use registry::ComponentBridge;pub use registry::DynamicAssetRegistry;pub use registry::DynamicComponentRegistry;pub use registry::DynamicResourceRegistry;pub use registry::ExtractFn;pub use registry::MessageBridge;pub use registry::PluginConfigs;pub use registry::PyRustComponentBatch;pub use registry::ResourceBridge;pub use registry::batch_field_meta_for;pub use registry::field_offset_view_meta_for;pub use registry::set_field_from_numpy;pub use reload_request::CustomComponentEntry;pub use reload_request::CustomComponentInfo;pub use reload_request::CustomResourceEntry;pub use reload_request::CustomResourceInfo;pub use reload_request::LastSystemError;pub use reload_request::PendingReloadRequest;pub use reload_request::PyResourceStorage;pub use reload_request::ReloadRequestMode;pub use reload_request::ReloadResult;pub use resource::PyResource;pub use uuid;
Modules§
- asset
- Asset base class and trait for PyBevy asset wrappers
- asset_
path - component
- Base component class for PyBevy
- component_
storage - Generic component storage supporting both owned and borrowed instances
- debug_
snapshot - Cross-crate debug/performance snapshot.
- entity
- Entity wrapper for PyBevy
- field_
storage - Generic field storage supporting both owned and borrowed instances
- handle
- Asset handle wrapper for PyBevy
- hierarchy
- Hierarchy component wrappers
- list_
storage - Generic list storage supporting both owned and borrowed Vec instances
- materializable
- message
- Message base types for PyBevy
- plugin
- Plugin base class and bridge trait for PyBevy
- registry
- Runtime type registries for PyBevy
- reload_
request - Cross-crate reload request mailbox and shared resources.
- resource
- Base resource class for PyBevy
- resource_
storage - Generic resource storage supporting both owned and borrowed instances
- storage
- Storage types for PyBevy wrappers
- storage_
error - PyO3-independent error types for storage operations
- storage_
traits - Core storage traits for PyBevy
- validity_
guard - Runtime validity checking for system parameters
- value_
storage - Generic value storage supporting both owned and borrowed instances
- view_
bridge - View API bridge trait for runtime type dispatch
Structs§
- Asset
Storage - Generic storage for PyBevy assets
- Child
OfBridge - Children
Bridge - Component
Storage - Generic storage for PyBevy components
- Field
Offset - Field metadata for View API access
- Field
Storage - Generic storage for PyBevy field types (non-Copy types like TextureAtlas)
- List
Storage - Generic storage for Vec
fields - PyF32
List - Resource
Storage - Generic storage for PyBevy resources
- Validity
Flag - A validity flag that can be shared across multiple system parameters and checked to ensure they’re only used during system execution.
- Validity
Flag With Mode - A wrapper around ValidityFlag that enforces a specific access mode
- Validity
Guard - RAII guard that sets a validity flag to true on creation and automatically sets it to false when dropped.
- Value
Storage - Generic storage for PyBevy value types (Copy types like Vec3, Quat, etc.)
- View
Bridge - Bridge struct containing function pointers for View API operations
Enums§
- Access
Mode - Access mode for system parameters and query components
- Component
Storage Inner - Field
Storage Inner - List
Storage Inner - Resource
Storage Inner - Storage
Error - Errors returned by storage operations.
- Value
Storage Inner
Traits§
- Borrowable
Storage - Trait for storage types that can borrow field pointers with validity tracking
- From
Borrowed Storage - Trait for Python wrapper types that can be created from borrowed storage
- View
Field Access - Trait for components that support View API field access
Functions§
- normalize_
index - Normalize Python index (supports negative indexing)
- register_
core_ bridges - Register core component bridges with global registry. Call this from main crate during initialization.