Use more specific structs to represent an entry

This commit is contained in:
Rodolphe Breard 2019-07-11 22:19:09 +02:00
parent a9fb623791
commit ec5aabcf99
5 changed files with 114 additions and 44 deletions

View file

@ -8,7 +8,7 @@ fn on_event(entry: &Entry) {
#[event(LinkConnect)]
fn on_connect(entry: &Entry) {
info!("New client on session {:x}.", entry.session_id);
info!("New client on session {:x}.", entry.get_session_id());
}
fn main() {

View file

@ -9,7 +9,7 @@ struct MyContext {
#[report(Any)]
fn on_report(ctx: &mut MyContext, entry: &Entry) {
ctx.nb += 1;
info!("Event received: {}, {}", entry.session_id, ctx.nb);
info!("Event received: {}, {}", entry.get_session_id(), ctx.nb);
}
fn main() {