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: mod.rs
    path of file: ./repos/boa/core/engine/src/builtins/intl/collator
    
    the code of the file until where you have to start completion: use boa_gc::{custom_trace, Finalize, Trace};
use boa_profiler::Profiler;
use icu_collator::{
    provider::CollationMetadataV1Marker, AlternateHandling, CaseFirst, Collator as NativeCollator,
    MaxVariable, Numeric,
};

use icu_locid::{
    extensions::unicode::Value, extensions_unicode_key as key, extensions_unicode_value as value,
    Locale,
};
use icu_provider::DataLocale;

use crate::{
    builtins::{
        options::get_option, BuiltInBuilder, BuiltInConstructor, BuiltInObject, IntrinsicObject,
        OrdinaryObject,
    },
    context::{
        icu::IntlProvider,
        intrinsics::{Intrinsics, StandardConstructor, StandardConstructors},
    },
    js_string,
    native_function::NativeFunction,
    object::{
        internal_methods::get_prototype_from_constructor, FunctionObjectBuilder, JsFunction,
        JsObject,
    },
    property::Attribute,
    realm::Realm,
    string::{common::StaticJsStrings, utf16},
    symbol::JsSymbol,
    Context, JsArgs, JsData, JsNativeError, JsResult, JsString, JsValue,
};

use super::{
    locale::{canonicalize_locale_list, resolve_locale, supported_locales, validate_extension},
    options::{coerce_options_to_object, IntlOptions},
    Service,
};

mod options;
pub(crate) use options::*;

#[derive(Debug, Finalize, JsData)]
#[allow(clippy::struct_field_names)]
pub(crate) struct Collator {
    locale: Locale,
    collation: Value,
    numeric: bool,
    case_first: Option<CaseFirst>,
    usage: Usage,
    sensitivity: Sensitivity,
    ignore_punctuation: bool,
    collator: NativeCollator,
    bound_compare: Option<JsFunction>,
}

// SAFETY: only `bound_compare` is a traceable object.
unsafe impl Trace for Collator {
    custom_trace!(this, mark, mark(&this.bound_compare));
}

impl Collator {
    /// Gets the inner [`icu_collator::Collator`] comparator.
    pub(crate) const fn collator(&self) -> &icu_collator::Collator {
        &self.collator
    }
}

#[derive(Debug, Clone)]
pub(super) struct CollatorLocaleOptions {
    collation: Option<Value>,
    numeric: Option<bool>,
    case_first: Option<CaseFirst>,
}

impl Service for Collator {
    type LangMarker = CollationMetadataV1Marker;

    type LocaleOptions = CollatorLocaleOptions;

    fn resolve(locale: &mut Locale, options: &mut Self::LocaleOptions, provider: &IntlProvider) {
        let collation = options
            .collation
            .take()
            .filter(|co| {
                validate_extension::<Self::LangMarker>(locale.id.clone(), key!("co"), co, provider)
            })
            .or_else(|| {
                locale
                    .extensions
                    .unicode
                    .keywords
                    .get(&key!("co"))
                    .cloned()
                    .filter(|co| {
                        validate_extension::<Self::LangMarker>(
                            locale.id.clone(),
                            key!("co"),
                            co,
                            provider,
                        )
                    })
            })
            .filter(|co| co != &value!("search"));

        let numeric =
            options.numeric.or_else(
                || match locale.extensions.unicode.keywords.get(&key!("kn")) {
                    Some(a) if a == &value!("true") => Some(true),
                    Some(_) => Some(false),
                    _ => None,
                },
            );

        l
    
    fn resolved_options(this: &JsValue, _: &[JsValue], context: &mut Context) -> JsResult<JsValue> {
        // 1. Let collator be the this value.
        // 2. Perform ? RequireInternalSlot(collator, [[InitializedCollator]]).
        let collator = this
            .as_object()
            .and_then(JsObject::downcast_ref::<Self>)
            .ok_or_else(|| {
                JsNativeError::typ()
                    .with_message("`resolvedOptions` can only be called on a `Collator` object")
            })?;

        // 3. Let options be OrdinaryObjectCreate(%Object.prototype%).
        let options = context
            .intrinsics()
            .templates()
            .ordinary_object()
            .create(OrdinaryObject, vec![]);

        // 4. For each row of Table 4, except the header row, in table order, do
        //     a. Let p be the Property value of the current row.
        //     b. Let v be the value of collator's internal slot whose name is the Internal Slot value of the current row.
        //     c. If the current row has an Extension Key value, then
        //         i. Let extensionKey be the Extension Key value of the current row.
        //         ii. If %Collator%.[[RelevantExtensionKeys]] does not contain extensionKey, then
        //             1. Let v be undefined.
        //     d. If v is not undefined, then
        //         i. Perform ! CreateDataPropertyOrThrow(options, p, v).
        // 5. Return options.
        options
            .create_data_property_or_throw(
                utf16!("locale"),
                js_string!(collator.locale.to_string()),
                context,
            )
            .expect("operation must not fail per the spec");
        options
            .create_data_property_or_throw(
                utf16!("usage"),
                match collator.usage {
                    Usage::Search => js_string!("search"),
                    Usage::Sort => js_string!("sort"),
                },
                context,
            )
            .expect("operation must not fail per the spec");
        options
            .create_data_property_or_throw(
                utf16!("sensitivity"),
                match collator.sensitivity {
                    Sensitivity::Base => js_string!("base"),
                    Sensitivity::Accent => js_string!("accent"),
                    Sensitivity::Case => js_string!("case"),
                    Sensitivity::Variant => js_string!("variant"),
                },
                context,
            )
            .expect("operation must not fail per the spec");
        options
            .create_data_property_or_throw(
                js_string!("ignorePunctuation"),
                collator.ignore_punctuation,
                context,
            )
            .expect("operation must not fail per the spec");
        options
            .create_data_property_or_throw(
                js_string!("collation"),
                js_string!(collator.collation.to_string()),
                context,
            )
            .expect("operation must not fail per the spec");
        options
            .create_data_property_or_throw(utf16!("numeric"), collator.numeric, context)
            .expect("operation must not fail per the spec");
        if let Some(kf) = collator.case_first {
            options
                .create_data_property_or_throw(
                    js_string!("caseFirst"),
                    match kf {
                        CaseFirst::Off => js_string!("false"),
                        CaseFirst::LowerFirst => js_string!("lower"),
                        CaseFirst::UpperFirst => js_string!("upper"),
                        _ => unreachable!(),
                    },
                    context,
                )
                .expect("operation must not fail per the spec");
        }

        // 5. Return options.
        Ok(options.into())
    }