tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ZonedDateFormatterGregorian.mjs (23607B)


      1 // generated by diplomat-tool
      2 import { DataProvider } from "./DataProvider.mjs"
      3 import { DateFormatterGregorian } from "./DateFormatterGregorian.mjs"
      4 import { DateTimeFormatterLoadError } from "./DateTimeFormatterLoadError.mjs"
      5 import { DateTimeWriteError } from "./DateTimeWriteError.mjs"
      6 import { IsoDate } from "./IsoDate.mjs"
      7 import { Locale } from "./Locale.mjs"
      8 import { TimeZoneInfo } from "./TimeZoneInfo.mjs"
      9 import wasm from "./diplomat-wasm.mjs";
     10 import * as diplomatRuntime from "./diplomat-runtime.mjs";
     11 
     12 
     13 /**
     14 * See the [Rust documentation for `FixedCalendarDateTimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.FixedCalendarDateTimeFormatter.html) for more information.
     15 */
     16 const ZonedDateFormatterGregorian_box_destroy_registry = new FinalizationRegistry((ptr) => {
     17    wasm.icu4x_ZonedDateFormatterGregorian_destroy_mv1(ptr);
     18 });
     19 
     20 export class ZonedDateFormatterGregorian {
     21    // Internal ptr reference:
     22    #ptr = null;
     23 
     24    // Lifetimes are only to keep dependencies alive.
     25    // Since JS won't garbage collect until there are no incoming edges.
     26    #selfEdge = [];
     27 
     28    #internalConstructor(symbol, ptr, selfEdge) {
     29        if (symbol !== diplomatRuntime.internalConstructor) {
     30            console.error("ZonedDateFormatterGregorian is an Opaque type. You cannot call its constructor.");
     31            return;
     32        }
     33        this.#ptr = ptr;
     34        this.#selfEdge = selfEdge;
     35 
     36        // Are we being borrowed? If not, we can register.
     37        if (this.#selfEdge.length === 0) {
     38            ZonedDateFormatterGregorian_box_destroy_registry.register(this, this.#ptr);
     39        }
     40 
     41        return this;
     42    }
     43    get ffiValue() {
     44        return this.#ptr;
     45    }
     46 
     47 
     48    /**
     49     * Creates a zoned formatter based on a non-zoned formatter.
     50     *
     51     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
     52     * or else unexpected behavior may occur!
     53     *
     54     * See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information.
     55     */
     56    static createSpecificLong(locale, formatter) {
     57        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
     58 
     59 
     60        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_specific_long_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue);
     61 
     62        try {
     63            if (!diplomatReceive.resultFlag) {
     64                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
     65                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
     66            }
     67            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
     68        }
     69 
     70        finally {
     71            diplomatReceive.free();
     72        }
     73    }
     74 
     75    /**
     76     * Creates a zoned formatter based on a non-zoned formatter.
     77     *
     78     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
     79     * or else unexpected behavior may occur!
     80     *
     81     * See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information.
     82     */
     83    static createSpecificLongWithProvider(provider, locale, formatter) {
     84        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
     85 
     86 
     87        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_specific_long_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue);
     88 
     89        try {
     90            if (!diplomatReceive.resultFlag) {
     91                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
     92                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
     93            }
     94            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
     95        }
     96 
     97        finally {
     98            diplomatReceive.free();
     99        }
    100    }
    101 
    102    /**
    103     * Creates a zoned formatter based on a non-zoned formatter.
    104     *
    105     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
    106     * or else unexpected behavior may occur!
    107     *
    108     * See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information.
    109     */
    110    static createSpecificShort(locale, formatter) {
    111        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    112 
    113 
    114        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_specific_short_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue);
    115 
    116        try {
    117            if (!diplomatReceive.resultFlag) {
    118                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    119                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
    120            }
    121            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
    122        }
    123 
    124        finally {
    125            diplomatReceive.free();
    126        }
    127    }
    128 
    129    /**
    130     * Creates a zoned formatter based on a non-zoned formatter.
    131     *
    132     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
    133     * or else unexpected behavior may occur!
    134     *
    135     * See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information.
    136     */
    137    static createSpecificShortWithProvider(provider, locale, formatter) {
    138        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    139 
    140 
    141        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_specific_short_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue);
    142 
    143        try {
    144            if (!diplomatReceive.resultFlag) {
    145                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    146                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
    147            }
    148            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
    149        }
    150 
    151        finally {
    152            diplomatReceive.free();
    153        }
    154    }
    155 
    156    /**
    157     * Creates a zoned formatter based on a non-zoned formatter.
    158     *
    159     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
    160     * or else unexpected behavior may occur!
    161     *
    162     * See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information.
    163     */
    164    static createLocalizedOffsetLong(locale, formatter) {
    165        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    166 
    167 
    168        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_localized_offset_long_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue);
    169 
    170        try {
    171            if (!diplomatReceive.resultFlag) {
    172                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    173                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
    174            }
    175            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
    176        }
    177 
    178        finally {
    179            diplomatReceive.free();
    180        }
    181    }
    182 
    183    /**
    184     * Creates a zoned formatter based on a non-zoned formatter.
    185     *
    186     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
    187     * or else unexpected behavior may occur!
    188     *
    189     * See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information.
    190     */
    191    static createLocalizedOffsetLongWithProvider(provider, locale, formatter) {
    192        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    193 
    194 
    195        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_localized_offset_long_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue);
    196 
    197        try {
    198            if (!diplomatReceive.resultFlag) {
    199                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    200                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
    201            }
    202            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
    203        }
    204 
    205        finally {
    206            diplomatReceive.free();
    207        }
    208    }
    209 
    210    /**
    211     * Creates a zoned formatter based on a non-zoned formatter.
    212     *
    213     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
    214     * or else unexpected behavior may occur!
    215     *
    216     * See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information.
    217     */
    218    static createLocalizedOffsetShort(locale, formatter) {
    219        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    220 
    221 
    222        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_localized_offset_short_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue);
    223 
    224        try {
    225            if (!diplomatReceive.resultFlag) {
    226                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    227                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
    228            }
    229            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
    230        }
    231 
    232        finally {
    233            diplomatReceive.free();
    234        }
    235    }
    236 
    237    /**
    238     * Creates a zoned formatter based on a non-zoned formatter.
    239     *
    240     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
    241     * or else unexpected behavior may occur!
    242     *
    243     * See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information.
    244     */
    245    static createLocalizedOffsetShortWithProvider(provider, locale, formatter) {
    246        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    247 
    248 
    249        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_localized_offset_short_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue);
    250 
    251        try {
    252            if (!diplomatReceive.resultFlag) {
    253                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    254                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
    255            }
    256            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
    257        }
    258 
    259        finally {
    260            diplomatReceive.free();
    261        }
    262    }
    263 
    264    /**
    265     * Creates a zoned formatter based on a non-zoned formatter.
    266     *
    267     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
    268     * or else unexpected behavior may occur!
    269     *
    270     * See the [Rust documentation for `GenericLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information.
    271     */
    272    static createGenericLong(locale, formatter) {
    273        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    274 
    275 
    276        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_generic_long_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue);
    277 
    278        try {
    279            if (!diplomatReceive.resultFlag) {
    280                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    281                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
    282            }
    283            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
    284        }
    285 
    286        finally {
    287            diplomatReceive.free();
    288        }
    289    }
    290 
    291    /**
    292     * Creates a zoned formatter based on a non-zoned formatter.
    293     *
    294     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
    295     * or else unexpected behavior may occur!
    296     *
    297     * See the [Rust documentation for `GenericLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information.
    298     */
    299    static createGenericLongWithProvider(provider, locale, formatter) {
    300        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    301 
    302 
    303        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_generic_long_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue);
    304 
    305        try {
    306            if (!diplomatReceive.resultFlag) {
    307                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    308                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
    309            }
    310            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
    311        }
    312 
    313        finally {
    314            diplomatReceive.free();
    315        }
    316    }
    317 
    318    /**
    319     * Creates a zoned formatter based on a non-zoned formatter.
    320     *
    321     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
    322     * or else unexpected behavior may occur!
    323     *
    324     * See the [Rust documentation for `GenericShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information.
    325     */
    326    static createGenericShort(locale, formatter) {
    327        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    328 
    329 
    330        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_generic_short_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue);
    331 
    332        try {
    333            if (!diplomatReceive.resultFlag) {
    334                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    335                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
    336            }
    337            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
    338        }
    339 
    340        finally {
    341            diplomatReceive.free();
    342        }
    343    }
    344 
    345    /**
    346     * Creates a zoned formatter based on a non-zoned formatter.
    347     *
    348     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
    349     * or else unexpected behavior may occur!
    350     *
    351     * See the [Rust documentation for `GenericShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information.
    352     */
    353    static createGenericShortWithProvider(provider, locale, formatter) {
    354        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    355 
    356 
    357        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_generic_short_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue);
    358 
    359        try {
    360            if (!diplomatReceive.resultFlag) {
    361                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    362                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
    363            }
    364            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
    365        }
    366 
    367        finally {
    368            diplomatReceive.free();
    369        }
    370    }
    371 
    372    /**
    373     * Creates a zoned formatter based on a non-zoned formatter.
    374     *
    375     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
    376     * or else unexpected behavior may occur!
    377     *
    378     * See the [Rust documentation for `Location`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.Location.html) for more information.
    379     */
    380    static createLocation(locale, formatter) {
    381        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    382 
    383 
    384        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_location_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue);
    385 
    386        try {
    387            if (!diplomatReceive.resultFlag) {
    388                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    389                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
    390            }
    391            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
    392        }
    393 
    394        finally {
    395            diplomatReceive.free();
    396        }
    397    }
    398 
    399    /**
    400     * Creates a zoned formatter based on a non-zoned formatter.
    401     *
    402     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
    403     * or else unexpected behavior may occur!
    404     *
    405     * See the [Rust documentation for `Location`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.Location.html) for more information.
    406     */
    407    static createLocationWithProvider(provider, locale, formatter) {
    408        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    409 
    410 
    411        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_location_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue);
    412 
    413        try {
    414            if (!diplomatReceive.resultFlag) {
    415                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    416                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
    417            }
    418            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
    419        }
    420 
    421        finally {
    422            diplomatReceive.free();
    423        }
    424    }
    425 
    426    /**
    427     * Creates a zoned formatter based on a non-zoned formatter.
    428     *
    429     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
    430     * or else unexpected behavior may occur!
    431     *
    432     * See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information.
    433     */
    434    static createExemplarCity(locale, formatter) {
    435        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    436 
    437 
    438        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_exemplar_city_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue);
    439 
    440        try {
    441            if (!diplomatReceive.resultFlag) {
    442                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    443                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
    444            }
    445            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
    446        }
    447 
    448        finally {
    449            diplomatReceive.free();
    450        }
    451    }
    452 
    453    /**
    454     * Creates a zoned formatter based on a non-zoned formatter.
    455     *
    456     * Caution: The locale provided here must match the locale used to construct the non-zoned formatter,
    457     * or else unexpected behavior may occur!
    458     *
    459     * See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information.
    460     */
    461    static createExemplarCityWithProvider(provider, locale, formatter) {
    462        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    463 
    464 
    465        const result = wasm.icu4x_ZonedDateFormatterGregorian_create_exemplar_city_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue);
    466 
    467        try {
    468            if (!diplomatReceive.resultFlag) {
    469                const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    470                throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause });
    471            }
    472            return new ZonedDateFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
    473        }
    474 
    475        finally {
    476            diplomatReceive.free();
    477        }
    478    }
    479 
    480    /**
    481     * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.format) for more information.
    482     */
    483    formatIso(date, zone) {
    484        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
    485 
    486        const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
    487 
    488 
    489        const result = wasm.icu4x_ZonedDateFormatterGregorian_format_iso_mv1(diplomatReceive.buffer, this.ffiValue, date.ffiValue, zone.ffiValue, write.buffer);
    490 
    491        try {
    492            if (!diplomatReceive.resultFlag) {
    493                const cause = new DateTimeWriteError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
    494                throw new globalThis.Error('DateTimeWriteError: ' + cause.value, { cause });
    495            }
    496            return write.readString8();
    497        }
    498 
    499        finally {
    500            diplomatReceive.free();
    501            write.free();
    502        }
    503    }
    504 
    505    constructor(symbol, ptr, selfEdge) {
    506        return this.#internalConstructor(...arguments)
    507    }
    508 }