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: validations.rs
    path of file: ./repos/valence/crates/java_string/src
    
    the code of the file until where you have to start completion: use std::ops::{Bound, Range, RangeBounds, RangeTo};

use crate::{JavaStr, Utf8Error};

pub(crate) const TAG_CONT: u8 = 0b1000_0000;
pub(crate) const TAG_TWO_B: u8 = 0b1100_0000;
pub(crate) const TAG_THREE_B: u8 = 0b1110_0000;
pub(crate) const TAG_FOUR_B: u8 = 0b1111_0000;
pub(crate) const CONT_MASK: u8 = 0b0011_1111;

#[inline]
const fn utf8_first_byte(byte: u8, width: u32) -> u32 {
    (byte & (0x7f >> width)) as u32
}

#[inline]
const fn utf8_acc_cont_byte(ch: u32, byte: u8
    
pub(crate) const fn run_utf8_full_validation_from_semi(v: &[u8]) -> Result<(), Utf8Error> {
    // this function checks for surrogate codepoints, between \u{d800} to \u{dfff},
    // or ED A0 80 to ED BF BF of width 3 unicode chars. The valid range of width 3
    // characters is ED 80 80 to ED BF BF, so we need to check for an ED byte
    // followed by a >=A0 byte.
    let mut index = 0;
    while index + 3 <= v.len() {
        if v[index] == 0xed && v[index + 1] >= 0xa0 {
            return Err(Utf8Error {
                valid_up_to: index,
                error_len: Some(1),
            });
        }
        index += 1;
    }

    Ok(())
}