Struct ServerListenerRegistry
pub struct ServerListenerRegistry { /* private fields */ }Expand description
The game’s ServerReloadListeners.
Trait Implementations§
§impl ServerReloadListeners for ServerListenerRegistry
impl ServerReloadListeners for ServerListenerRegistry
§fn add_listener(
&mut self,
id: Identifier,
converter: FileToIdConverter,
listener: Arc<dyn ServerReloadListener>,
) -> Result<(), ReloadOrderError>
fn add_listener( &mut self, id: Identifier, converter: FileToIdConverter, listener: Arc<dyn ServerReloadListener>, ) -> Result<(), ReloadOrderError>
Register a unique listener and converter, e.g.
FileToIdConverter::json("machines").
Keep the Arc to read the listener’s published state outside reloads.§fn add_retained(
&mut self,
id: Identifier,
converter: FileToIdConverter,
listener: Arc<dyn ServerReloadListener>,
retained: Arc<dyn Any + Send + Sync>,
) -> Result<(), ReloadOrderError>
fn add_retained( &mut self, id: Identifier, converter: FileToIdConverter, listener: Arc<dyn ServerReloadListener>, retained: Arc<dyn Any + Send + Sync>, ) -> Result<(), ReloadOrderError>
add_listener, keeping retained (the listener itself, as the
mod holds it) in the reload resources; mods reach it through add_retained_listener.§fn add_dependency(
&mut self,
first: Identifier,
second: Identifier,
) -> Result<(), ReloadOrderError>
fn add_dependency( &mut self, first: Identifier, second: Identifier, ) -> Result<(), ReloadOrderError>
Require
first before second; both names must already be registered.§fn get_registry(&self) -> Vec<Identifier>
fn get_registry(&self) -> Vec<Identifier>
The registered names in registration order, boundaries included.
§fn get_graph(&self) -> Vec<(Identifier, Identifier)>
fn get_graph(&self) -> Vec<(Identifier, Identifier)>
The dependency edges as
(first, second) names.§fn get_last_vanilla_listener(&self) -> Identifier
fn get_last_vanilla_listener(&self) -> Identifier
The name of the vanilla anchor preceding mod listeners by default.
Auto Trait Implementations§
impl !RefUnwindSafe for ServerListenerRegistry
impl !UnwindSafe for ServerListenerRegistry
impl Freeze for ServerListenerRegistry
impl Send for ServerListenerRegistry
impl Sync for ServerListenerRegistry
impl Unpin for ServerListenerRegistry
impl UnsafeUnpin for ServerListenerRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more