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: framebuffer.rs
    path of file: ./repos/bracket-lib/bracket-terminal/src/hal/gl_common
    
    the code of the file until where you have to start completion: #[allow(unused_imports)]
use crate::BResult;
use glow::HasContext;

use super::{FramebufferId, TextureId};

#[cfg(not(target_arch = "wasm32"))]
pub struct Framebuffer {
    fbo: FramebufferId,
    pub texture: TextureId,
}

#[cfg(target_arch = "wasm32")]
pub struct Framebuffer {
    fbo: glow::WebFramebufferKey,
    pub texture: glow::WebTextureKey,
}

impl Framebuffer {
    #[cfg(not(target_arch = "wasm32"))]
    pub fn build_fbo(gl: &glow::Context, width: i32, height: i32) -> BResult<Framebuffer> {
        let fbo;
        let buffer;

        unsafe {
         
    
    pub fn build_fbo(gl: &glow::Context, width: i32, height: i32) -> BResult<Framebuffer> {
        let fbo;
        let buffer;

        unsafe {
            fbo = gl.create_framebuffer()?;
            gl.bind_framebuffer(glow::FRAMEBUFFER, Some(fbo));
            buffer = gl.create_texture()?;

            gl.bind_texture(glow::TEXTURE_2D, Some(buffer));
            gl.tex_image_2d(
                glow::TEXTURE_2D,
                0,
                glow::RGBA as i32,
                width,
                height,
                0,
                glow::RGBA,
                glow::FLOAT,
                None,
            );
            gl.tex_parameter_i32(
                glow::TEXTURE_2D,
                glow::TEXTURE_MIN_FILTER,
                glow::NEAREST as i32,
            );
            gl.tex_parameter_i32(
                glow::TEXTURE_2D,
                glow::TEXTURE_MAG_FILTER,
                glow::NEAREST as i32,
            );
            gl.tex_parameter_i32(
                glow::TEXTURE_2D,
                glow::TEXTURE_WRAP_S,
                glow::CLAMP_TO_EDGE as i32,
            );
            gl.tex_parameter_i32(
                glow::TEXTURE_2D,
                glow::TEXTURE_WRAP_T,
                glow::CLAMP_TO_EDGE as i32,
            );
            // attach texture to framebuffer
            gl.framebuffer_texture_2d(
                glow::FRAMEBUFFER,
                glow::COLOR_ATTACHMENT0,
                glow::TEXTURE_2D,
                Some(buffer),
                0,
            );
            gl.bind_framebuffer(glow::FRAMEBUFFER, None);
        }

        let framebuffer = Framebuffer {
            fbo,
            texture: buffer,
        };
        Ok(framebuffer)
    }