Start work on generalizing the BlockMap to allow arbitrary elements
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
e668ff8bcd
commit
0c714210ff
7 changed files with 579 additions and 897 deletions
|
@ -301,6 +301,10 @@ impl<T: Element> Default for Lifecycle<T> {
|
|||
}
|
||||
|
||||
impl ElementBox {
|
||||
pub fn name(&self) -> Option<&str> {
|
||||
self.0.name.as_deref()
|
||||
}
|
||||
|
||||
pub fn metadata<T: 'static>(&self) -> Option<&T> {
|
||||
let element = unsafe { &*self.0.element.as_ptr() };
|
||||
element.metadata().and_then(|m| m.downcast_ref())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue