Use more specific structs to represent an entry
This commit is contained in:
parent
a9fb623791
commit
ec5aabcf99
5 changed files with 114 additions and 44 deletions
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
Reference in a new issue