Broaden debug implementation

This commit is contained in:
Diggory Blake 2023-08-14 15:54:55 +01:00
parent bf9ed6ae36
commit 4d0f5f3dc7
No known key found for this signature in database
GPG key ID: E6BDFA83146ABD40
2 changed files with 8 additions and 3 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "aerosol"
version = "1.0.0-alpha.7"
version = "1.0.0-alpha.8"
authors = ["Diggory Blake <diggsey@googlemail.com>"]
edition = "2018"
description = "Simple dependency injection for Rust"

View file

@ -1,4 +1,4 @@
use std::{any::Any, marker::PhantomData, sync::Arc, task::Poll};
use std::{any::Any, fmt::Debug, marker::PhantomData, sync::Arc, task::Poll};
use anymap::hashbrown::{Entry, Map};
use frunk::{
@ -20,13 +20,18 @@ pub(crate) struct InnerAero {
/// Stores a collection of resources keyed on resource type.
/// Provides methods for accessing this collection.
/// Can be cheaply cloned.
#[derive(Debug)]
#[repr(transparent)]
pub struct Aero<R: ResourceList = HNil> {
pub(crate) inner: Arc<RwLock<InnerAero>>,
pub(crate) phantom: PhantomData<Arc<R>>,
}
impl<R: ResourceList> Debug for Aero<R> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.inner.fmt(f)
}
}
impl Aero {
/// Construct a new instance of the type with no initial resources.
pub fn new() -> Self {