pub trait ObjectArena: 'static + Default {
type Object: Object<Handle = Self::Handle, Arena = Self>;
type Handle: Handle<Object = Self::Object>;
// Required methods
fn try_get(handle: Self::Handle, w: Wr<'_>) -> Option<&Self::Object>;
fn try_get_mut(handle: Self::Handle, w: W<'_>) -> Option<&mut Self::Object>;
fn as_strong_if_alive(
handle: Self::Handle,
w: W<'_>,
) -> Option<Strong<Self::Handle>>;
fn print_debug(
f: &mut Formatter<'_>,
handle: Self::Handle,
w: Wr<'_>,
) -> Result;
}Expand description
A custom arena managing a specific type of Object.
This is likely only relevant to you if you are implementing a
custom arena.
Required Associated Types§
Required Methods§
Sourcefn try_get(handle: Self::Handle, w: Wr<'_>) -> Option<&Self::Object>
fn try_get(handle: Self::Handle, w: Wr<'_>) -> Option<&Self::Object>
Implements the Handle::try_r operation.
Sourcefn try_get_mut(handle: Self::Handle, w: W<'_>) -> Option<&mut Self::Object>
fn try_get_mut(handle: Self::Handle, w: W<'_>) -> Option<&mut Self::Object>
Implements the Handle::try_m operation.
Sourcefn as_strong_if_alive(
handle: Self::Handle,
w: W<'_>,
) -> Option<Strong<Self::Handle>>
fn as_strong_if_alive( handle: Self::Handle, w: W<'_>, ) -> Option<Strong<Self::Handle>>
Implements the Handle::as_strong_if_alive operation.
Sourcefn print_debug(f: &mut Formatter<'_>, handle: Self::Handle, w: Wr<'_>) -> Result
fn print_debug(f: &mut Formatter<'_>, handle: Self::Handle, w: Wr<'_>) -> Result
Implements the Handle’s fmt::Debug operation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.