I'm using the acpi crate to parse MADT but it looks like the PhysicalMapping cannot be dereferenced?
use ::acpi::sdt::madt::Madt;
use ::acpi::AcpiTables;
let tables = unsafe { AcpiTables::from_rsdp(AcpiHandler, rsdp.as_ptr().addr()) }
.unwrap_or_else(|x| panic!("Failed to parse RSDP table: {:?}", x));
let mut madt = tables.find_table::<Madt>().expect("Failed to find MADT");
madt.entries().for_each(|entry| {}); // no method named `entries` found for struct `PhysicalMapping<H, T>` in the current scope
When I try to use .deref() manually, this is the error:
use ::acpi::sdt::madt::Madt;
use ::acpi::AcpiTables;
madt.deref().entries().for_each(|entry| {});
// the method `deref` exists for struct `PhysicalMapping<AcpiHandler, Madt>`, but its trait bounds were not satisfied [E0599]
// method cannot be called on `PhysicalMapping<AcpiHandler, Madt>` due to unsatisfied trait bounds
// Note: the following trait bounds were not satisfied:
// `Madt: Unpin`
// which is required by `PhysicalMapping<AcpiHandler, Madt>: Deref`
I tried using pin! to pin the madt since entries take reference to self via Pin. And result is still same.
It doesn't work for other fields as well.
Could it be because I disabled default features? By the way, crate still requires a global allocator even though all default features are disabled. And yes, my project requires me to not use any dynamic allocations. So currently there's a null allocator as a global allocator.
I'm using the acpi crate to parse MADT but it looks like the PhysicalMapping cannot be dereferenced?
When I try to use
.deref()manually, this is the error:I tried using
pin!to pin the madt sinceentriestake reference to self viaPin. And result is still same.It doesn't work for other fields as well.
Could it be because I disabled default features? By the way, crate still requires a global allocator even though all default features are disabled. And yes, my project requires me to not use any dynamic allocations. So currently there's a null allocator as a global allocator.