pub struct UserHooks<'lua> { /* private fields */ }
Implementations§
Source§impl<'lua> UserHooks<'lua>
impl<'lua> UserHooks<'lua>
pub fn new(lua: HooksLua<'lua>) -> Self
pub fn register(&mut self) -> Result<()>
pub fn on_mission_load_begin<F>(&mut self, f: F) -> Result<&mut Self>
Sourcepub fn on_mission_load_progress<F>(&mut self, f: F) -> Result<&mut Self>
pub fn on_mission_load_progress<F>(&mut self, f: F) -> Result<&mut Self>
f(progress, message)
pub fn on_mission_load_end<F>(&mut self, f: F) -> Result<&mut Self>
pub fn on_simulation_start<F>(&mut self, f: F) -> Result<&mut Self>
pub fn on_simulation_stop<F>(&mut self, f: F) -> Result<&mut Self>
pub fn on_simulation_frame<F>(&mut self, f: F) -> Result<&mut Self>
pub fn on_simulation_pause<F>(&mut self, f: F) -> Result<&mut Self>
pub fn on_simulation_resume<F>(&mut self, f: F) -> Result<&mut Self>
pub fn on_player_connect<F>(&mut self, f: F) -> Result<&mut Self>
pub fn on_player_disconnect<F>(&mut self, f: F) -> Result<&mut Self>
pub fn on_player_start<F>(&mut self, f: F) -> Result<&mut Self>
pub fn on_player_stop<F>(&mut self, f: F) -> Result<&mut Self>
pub fn on_player_change_slot<F>(&mut self, f: F) -> Result<&mut Self>
Sourcepub fn on_player_try_connect<F>(&mut self, f: F) -> Result<&mut Self>
pub fn on_player_try_connect<F>(&mut self, f: F) -> Result<&mut Self>
f(addr, ucid, name, id), return None
to accept the player,
return Some("reason for rejection")
to reject the player.
Sourcepub fn on_player_try_send_chat<F>(&mut self, f: F) -> Result<&mut Self>
pub fn on_player_try_send_chat<F>(&mut self, f: F) -> Result<&mut Self>
f(id, message, all)
Trait Implementations§
Auto Trait Implementations§
impl<'lua> Freeze for UserHooks<'lua>
impl<'lua> !RefUnwindSafe for UserHooks<'lua>
impl<'lua> !Send for UserHooks<'lua>
impl<'lua> !Sync for UserHooks<'lua>
impl<'lua> Unpin for UserHooks<'lua>
impl<'lua> !UnwindSafe for UserHooks<'lua>
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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.