// SAFETY: this is safe because the `WithContext` function pointer is valid
// for the lifetime of `&self`.
this is safe because the `WithContext` function pointer is valid
for the lifetime of `&self`.
this is safe because the ` WithContext ` function pointer is valid for the lifetime of ` &self ` .
unsafe fn downcast_raw(&self, id: TypeId) -> Option<*const ()> {
        match id {
            id if id == TypeId::of::<Self>() => Some(self as *const _ as *const ()),
            id if id == TypeId::of::<WithContext>() => {
                Some(&self.get_context as *const _ as *const ())
            }
            _ => None,
        }
    }
unsafe fn downcast_raw ( & self , id : TypeId ) -> Option < * const ( ) > { match id { id if id == TypeId :: of :: < Self > ( ) => Some ( self as * const _ as * const ( ) ) , id if id == TypeId :: of :: < WithContext > ( ) => { Some ( & self . get_context as * const _ as * const ( ) ) } _ => None , } }
SAFETY: this is safe because the `WithContext` function pointer is valid
for the lifetime of `&self`.
SAFETY : this is safe because the ` WithContext ` function pointer is valid for the lifetime of ` &self ` .
&self
id
TypeId