ObjectUtils

Trait ObjectUtils 

Source
pub trait ObjectUtils: Object {
    // Provided methods
    fn try_get_handler_ref<T>(
        &self,
    ) -> Result<HandlerRef<'_, T>, HandlerAccessError>
       where T: 'static { ... }
    fn get_handler_ref<T>(&self) -> HandlerRef<'_, T>
       where T: 'static { ... }
    fn try_get_handler_mut<T>(
        &self,
    ) -> Result<HandlerMut<'_, T>, HandlerAccessError>
       where T: 'static { ... }
    fn get_handler_mut<T>(&self) -> HandlerMut<'_, T>
       where T: 'static { ... }
}
Expand description

Utilities for Objects.

Provided Methods§

Source

fn try_get_handler_ref<T>( &self, ) -> Result<HandlerRef<'_, T>, HandlerAccessError>
where T: 'static,

Tries to get a shared reference to the handler.

Source

fn get_handler_ref<T>(&self) -> HandlerRef<'_, T>
where T: 'static,

Gets a shared reference to the handler.

This function panics if a HandlerAccessError occurs.

Source

fn try_get_handler_mut<T>( &self, ) -> Result<HandlerMut<'_, T>, HandlerAccessError>
where T: 'static,

Tries to get a mutable reference to the handler.

Source

fn get_handler_mut<T>(&self) -> HandlerMut<'_, T>
where T: 'static,

Gets a mutable reference to the handler.

This function panics if a HandlerAccessError occurs.

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.

Implementors§

Source§

impl<T> ObjectUtils for T
where T: Object + ?Sized,