Expand description
A library for calling function on certain events.
Zila is a fast and reliable library for performing tasks on certian events. It propvides both syncronuos and asyncronuos functions to make writing Rust code esier.
§A Tour of Zila
Zila consists of a number of functions that provide essential for implementing event based applications in Rust. In this section, we will take a brief tour of zila, summarizing the major APIs and their uses.
The easiest way to get started is to enable all features. Do this by
enabling the full
feature flag:
zila = { version = "0.1.8", features = ["full"] }
§Authoring applications
Zila is great for writing applications and most users in this case shouldn’t
worry too much about what features they should pick. If you’re unsure, we suggest
going with full
to ensure that you don’t run into any road blocks while you’re
building your application.
§Example
A basic logger with zila.
Make sure you activated the second
featureof the zill crate on Cargo.toml
zila = { version = "0.1.8", features = ["second"] }
on your main.rs:
use zila::call_every_second;
fn main() {
call_every_second(|| {
println!("Hi");
});
}
More examples can be found here
Functions§
- call_
every_ day - calls the given function every day
- call_
every_ day_ async - calls the given async function every day
- call_
every_ day_ async_ mut - calls the given async function every day, takes a
FnMut
as the argument - call_
every_ day_ mut - calls the given function every day, takes a
FnMut
as the argument - call_
every_ hour - calls the given function every hour
- call_
every_ hour_ async - calls the given async function every hour
- call_
every_ hour_ async_ mut - calls the given async function every hour, takes a
FnMut
as the argument - call_
every_ hour_ mut - calls the given function every hour, takes a
FnMut
as the argument - call_
every_ minute - calls the given function every minute
- call_
every_ minute_ async - calls the given async function every minute
- call_
every_ minute_ async_ mut - calls the given async function every minute, takes a
FnMut
as the argument - call_
every_ minute_ mut - calls the given function every minute, takes a
FnMut
as the argument - call_
every_ second - calls the given function every second
- call_
every_ second_ async - calls the given async function every second
- call_
every_ second_ async_ mut - calls the given async function every second, takes a
FnMut
as the argument - call_
every_ second_ mut - calls the given function every second, takes a
FnMut
as the argument - duration_
to_ next_ day - Returns the duration to next day (00:00:00.000.000.000)
- duration_
to_ next_ hour - Returns the duration to next hour (__:00:00.000.000.000)
- duration_
to_ next_ minute - Returns the duration to next minute (__:__:00.000.000.000)
- duration_
to_ next_ second - Returns the duration to next second (__:__:__.000.000.000)
- set_
interval - calls the function in the specified intervals
- set_
interval_ async - calls the async function in the specified intervals
- set_
interval_ async_ mut - calls the async function in the specified intervals, takes
FnMut
as the first argument - set_
interval_ mut - calls the function in the specified intervals, takes
FnMut
as the first argument - set_
timeout - calls the function after the specified duration
- set_
timeout_ async - calls the async function after the specified duration
- set_
timeout_ async_ mut - calls the async function after the specified duration, takes
FnMut
as the first argument - set_
timeout_ mut - calls the function after the specified duration, takes
FnMut
as the first argument