You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: events.rs
    path of file: ./repos/tquic/src/qlog
    
    the code of the file until where you have to start completion: // Copyright (c) 2023 The TQUIC Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! Concrete qlog event definitions for QUIC, HTTP/3 and QPACK
//! - draft-ietf-quic-qlog-quic-events-06
//! - draft-ietf-quic-qlog-h3-events-05

use serde::Deserialize;
use serde::Serialize;
use smallvec::SmallVec;

/// Each event is specified as a generic object with a number of member fields
/// and their associated data.
#[serde_with::skip_serializing_none]
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct Event {
    /// The "time" field indicates the timestamp at which the event occurred.
    pub time: f32,

    /// The data field is a generic object. It contains the per-event metadata
    /// and its form and semantics are defined per specific so
    
    pub fn importance(&self) -> EventImportance {
        use crate::qlog::EventData::*;
        match *self {
            ConnectivityServerListening { .. } => EventImportance::Extra,
            ConnectivityConnectionStarted { .. } => EventImportance::Base,
            ConnectivityConnectionIdUpdated { .. } => EventImportance::Base,
            ConnectivitySpinBitUpdated { .. } => EventImportance::Base,
            ConnectivityConnectionStateUpdated { .. } => EventImportance::Base,
            ConnectivityMtuUpdated { .. } => EventImportance::Extra,

            QuicParametersSet { .. } => EventImportance::Core,
            QuicDatagramsReceived { .. } => EventImportance::Extra,
            QuicDatagramsSent { .. } => EventImportance::Extra,
            QuicDatagramDropped { .. } => EventImportance::Extra,
            QuicPacketReceived { .. } => EventImportance::Core,
            QuicPacketSent { .. } => EventImportance::Core,
            QuicPacketDropped { .. } => EventImportance::Base,
            QuicPacketBuffered { .. } => EventImportance::Base,
            QuicStreamStateUpdated { .. } => EventImportance::Base,
            QuicFramesProcessed { .. } => EventImportance::Extra,
            QuicStreamDataMoved { .. } => EventImportance::Base,

            SecurityKeyUpdated { .. } => EventImportance::Base,
            SecurityKeyDiscarded { .. } => EventImportance::Base,

            RecoveryParametersSet { .. } => EventImportance::Base,
            RecoveryMetricsUpdated { .. } => EventImportance::Core,
            RecoveryCongestionStateUpdated { .. } => EventImportance::Base,
            RecoveryLossTimerUpdated { .. } => EventImportance::Extra,
            RecoveryPacketLost { .. } => EventImportance::Core,
            RecoveryMarkedForRetransmit { .. } => EventImportance::Extra,

            H3ParametersSet { .. } => EventImportance::Base,
            H3StreamTypeSet { .. } => EventImportance::Base,
            H3FrameCreated { .. } => EventImportance::Core,
            H3FrameParsed { .. } => EventImportance::Core,
            H3PushResolved { .. } => EventImportance::Extra,

            QpackStateUpdated { .. } => EventImportance::Base,
            QpackStreamStateUpdated { .. } => EventImportance::Base,
            QpackDynamicTableUpdated { .. } => EventImportance::Extra,
            QpackHeadersEncoded { .. } => EventImportance::Base,
            QpackHeadersDecoded { .. } => EventImportance::Base,
            QpackInstructionCreated { .. } => EventImportance::Base,
            QpackInstructionParsed { .. } => EventImportance::Base,

            _ => unimplemented!(),
        }
    }