#![expect(missing_debug_implementations, clippy::empty_structs_with_brackets, reason = "Unit tests")]
pub struct ChatGpt {}
mod gpu {
#[derive(Clone, Default)]
pub struct Instance;
#[derive(Clone, Default)]
pub struct Device;
#[derive(Clone, Default)]
pub struct Vulkan;
#[fundle::bundle]
#[derive(Default)]
pub struct GpuBundle {
instance: Instance,
device: Device,
vulkan: Vulkan,
}
}
#[fundle::deps]
struct ChatGptDeps {
_vulkan: gpu::Vulkan,
_device: gpu::Device,
}
impl ChatGpt {
fn new(_: impl Into<ChatGptDeps>) -> Self {
Self {}
}
}
#[fundle::bundle]
pub struct AppState {
#[forward(gpu::Instance, gpu::Device, gpu::Vulkan)]
gpu: gpu::GpuBundle,
chat_gpt: ChatGpt,
}
fn main() {
let _ = AppState::builder()
.gpu(|_| gpu::GpuBundle::default())
.chat_gpt(|x| ChatGpt::new(x))
.build();
}