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: uint.rs
    path of file: ./repos/msgpack-rust/rmp/src/encode
    
    the code of the file until where you have to start completion: use super::{RmpWrite, write_marker};
use crate::encode::{ValueWriteError};
use crate::Marker;

/// E
    
pub fn write_uint<W: RmpWrite>(wr: &mut W, val: u64) -> Result<Marker, ValueWriteError<W::Error>> {
    if val < 128 {
        write_pfix(wr, val as u8)
            .and(Ok(Marker::FixPos(val as u8)))
            .map_err(ValueWriteError::InvalidMarkerWrite)
    } else if val < 256 {
        write_u8(wr, val as u8).and(Ok(Marker::U8))
    } else if val < 65536 {
        write_u16(wr, val as u16).and(Ok(Marker::U16))
    } else if val < 4294967296 {
        write_u32(wr, val as u32).and(Ok(Marker::U32))
    } else {
        write_u64(wr, val).and(Ok(Marker::U64))
    }
}