pub struct DayEnd { /* private fields */ }Expand description
The anvil-script.day_end service.
Implementations§
Source§impl DayEnd
impl DayEnd
Sourcepub fn get(host: &Host) -> Option<Self>
pub fn get(host: &Host) -> Option<Self>
The service; None without anvil-script, on an Anvil older than 1.18,
or on a build without the Day end’s symbols.
Sourcepub fn c_api(&self) -> Table<AnvilScriptDayEndService>
pub fn c_api(&self) -> Table<AnvilScriptDayEndService>
The C table, for what this crate does not wrap.
Sourcepub fn subscribe<F>(&self, host: &Host, handler: F) -> Result<()>
pub fn subscribe<F>(&self, host: &Host, handler: F) -> Result<()>
Calls handler at every Day end, after the handlers that subscribed
before it. WrongKind for a plugin with affects_gameplay = false,
WrongPhase once the game has ended a day. The handler is kept for
the process; a panic in it is logged once and that Day end goes on.
Trait Implementations§
Auto Trait Implementations§
impl Forget for DayEnd
impl Freeze for DayEnd
impl Move for DayEnd
impl RefUnwindSafe for DayEnd
impl Send for DayEnd
impl Sync for DayEnd
impl Unpin for DayEnd
impl UnsafeUnpin for DayEnd
impl UnwindSafe for DayEnd
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