Skip to main content

ServerReloadResources

Trait ServerReloadResources 

pub trait ServerReloadResources {
    // Required method
    fn retained(&self, id: &Identifier) -> Option<Arc<dyn Any + Send + Sync>>;
}
Expand description

The retained server reload listeners of the last successful reload, as NeoForge’s ReloadableServerResources, reached from ServerHost::reload_resources. A new reload replaces the whole store.

Required Methods§

fn retained(&self, id: &Identifier) -> Option<Arc<dyn Any + Send + Sync>>

The object retained under id, as its registering mod handed it over; mods read it through listener.

Implementations§

§

impl dyn ServerReloadResources + '_

pub fn listener<T>(&self, key: &ListenerKey<T>) -> Option<Arc<T>>

The retained listener registered under key in the last successful reload; None when nothing is registered under it, its type differs, or no reload has succeeded yet. The downcast itself checks the type.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§