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: oam.rs
    path of file: ./repos/zenoh/commons/zenoh-codec/src/transport
    
    the code of the file until where you have to start completion: //
// Copyright (c) 2022 ZettaScale Technology
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
//
// Contributors:
//   ZettaScale Zenoh Team, <zenoh@zettascale.tech>
//
use crate::{common::extension, RCodec, WCodec, Zenoh080, Zenoh080Header};
use zenoh_buffers::{
    reader::{DidntRead, Reader},
    writer::{DidntWrite, Writer},
    ZBuf,
};
use zenoh_protocol::{
    common::{iext, imsg, ZExtBody},
    transport::{
        id,
        oam::{ext, flag, Oam, OamId},
    },
};

impl<W> WCodec<&Oam, &mut W> for Zenoh080
where
    W: Writer,
{
    typ
    
    fn read(self, reader: &mut R) -> Result<Oam, Self::Error> {
        if imsg::mid(self.header) != id::OAM {
            return Err(DidntRead);
        }

        // Body
        let id: OamId = self.codec.read(&mut *reader)?;

        // Extensions
        let mut ext_qos = ext::QoSType::default();

        let mut has_ext = imsg::has_flag(self.header, flag::Z);
        while has_ext {
            let ext: u8 = self.codec.read(&mut *reader)?;
            let eodec = Zenoh080Header::new(ext);
            match iext::eid(ext) {
                ext::QoS::ID => {
                    let (q, ext): (ext::QoSType, bool) = eodec.read(&mut *reader)?;
                    ext_qos = q;
                    has_ext = ext;
                }
                _ => {
                    has_ext = extension::skip(reader, "OAM", ext)?;
                }
            }
        }

        // Payload
        let body = match self.header & iext::ENC_MASK {
            iext::ENC_UNIT => ZExtBody::Unit,
            iext::ENC_Z64 => {
                let u64: u64 = self.codec.read(&mut *reader)?;
                ZExtBody::Z64(u64)
            }
            iext::ENC_ZBUF => {
                let zbuf: ZBuf = self.codec.read(&mut *reader)?;
                ZExtBody::ZBuf(zbuf)
            }
            _ => return Err(DidntRead),
        };

        Ok(Oam { id, body, ext_qos })
    }