pub struct ContainerLayout {
pub components: usize,
pub setup: u32,
pub generic: usize,
pub available: usize,
pub overwrite: Option<(u32, usize)>,
}Expand description
Where the fields a container edit touches sit on the running build, resolved by the loader.
§Examples
See ContainerLayout::resolve and resize_container.
Fields§
§components: usizeA template’s components.
setup: u32The inventory setup component’s type hash.
generic: usizeIts count of generic slots, a u8.
available: usizeIts count of slots loot fills, a u8.
overwrite: Option<(u32, usize)>The setup override component’s type hash and its count of generic slots, where the build has it.
Implementations§
Source§impl ContainerLayout
impl ContainerLayout
Sourcepub fn resolve(facts: &(impl EngineFacts + ?Sized)) -> Result<Self, Off>
pub fn resolve(facts: &(impl EngineFacts + ?Sized)) -> Result<Self, Off>
The layout facts give: the running game’s through
Load, a game image’s in the loader and in tools.
§Errors
The first Off a fact returns, when the build lacks it.
§Examples
fn init(load: &mut enshwick::Load<'_>) -> Result<(), enshwick::Off> {
let layout = enshwick::content::containers::ContainerLayout::resolve(load)?;
enshwick::info!("generic slots at +{:#x}", layout.generic);
Ok(())
}Trait Implementations§
Source§impl Clone for ContainerLayout
impl Clone for ContainerLayout
impl Copy for ContainerLayout
Source§impl Debug for ContainerLayout
impl Debug for ContainerLayout
impl Eq for ContainerLayout
Source§impl PartialEq for ContainerLayout
impl PartialEq for ContainerLayout
impl StructuralPartialEq for ContainerLayout
Auto Trait Implementations§
impl Freeze for ContainerLayout
impl RefUnwindSafe for ContainerLayout
impl Send for ContainerLayout
impl Sync for ContainerLayout
impl Unpin for ContainerLayout
impl UnsafeUnpin for ContainerLayout
impl UnwindSafe for ContainerLayout
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