pub struct AppConfig {
pub home: String,
pub max_memory_mb: u32,
pub job_threads: u32,
}Expand description
Runtime half of the AppConfig asset: where the application keeps what it writes, and its process resource budgets.
Fields§
§home: StringWhere the running application writes its settings, saves, crash reports, and shader caches. Empty means beside the application’s data.
max_memory_mb: u32Soft ceiling on host memory the runtime aims to stay under, in
mebibytes. 0 = auto.
job_threads: u32Worker threads for the shared job pool. 0 = auto.
Implementations§
Trait Implementations§
Source§impl Component for AppConfig
impl Component for AppConfig
Source§const NAME: &'static str = "AppConfig"
const NAME: &'static str = "AppConfig"
The registry name a world authors this component under.
Source§fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
Reconstruct this component from a blob record, whose bytes are the
serialized runtime component (cook already ran the asset -> component
translation). The default rejects: runtime-only components are never
stored in a blob, so only loadable types provide an implementation.
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Called after construction to inject the payload locator from the blob def.
Only meaningful for components with a compiled payload.
The default implementation does nothing (correct for most components).
Source§fn inject_name(&mut self, _id: AssetId)
fn inject_name(&mut self, _id: AssetId)
Called after construction to inject the asset’s identity from the blob
def. Only meaningful for components that look themselves up by id at
runtime. The default implementation does nothing.
Source§impl ComponentSlot for AppConfig
impl ComponentSlot for AppConfig
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
The component type’s stable id, used as its
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<Self>
fn slot(s: &ComponentStorage) -> &Column<Self>
Borrow this type’s column out of the storage.
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>
Mutably borrow this type’s column out of the storage.
Source§impl<'de> Deserialize<'de> for AppConfig
impl<'de> Deserialize<'de> for AppConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<AppConfig> for ComponentAsset
impl From<AppConfig> for ComponentAsset
impl RuntimeComponent for AppConfig
Auto Trait Implementations§
impl Freeze for AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnsafeUnpin for AppConfig
impl UnwindSafe for AppConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more