// generated by diplomat-tool
import wasm from "./diplomat-wasm.mjs";
import * as diplomatRuntime from "./diplomat-runtime.mjs";



/**
 * See the [Rust documentation for `LineBreak`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html) for more information.
 */
export class LineBreak {
    #value = undefined;

    static #values = new Map([
        ["Unknown", 0],
        ["Ambiguous", 1],
        ["Alphabetic", 2],
        ["BreakBoth", 3],
        ["BreakAfter", 4],
        ["BreakBefore", 5],
        ["MandatoryBreak", 6],
        ["ContingentBreak", 7],
        ["ClosePunctuation", 8],
        ["CombiningMark", 9],
        ["CarriageReturn", 10],
        ["Exclamation", 11],
        ["Glue", 12],
        ["Hyphen", 13],
        ["Ideographic", 14],
        ["Inseparable", 15],
        ["InfixNumeric", 16],
        ["LineFeed", 17],
        ["Nonstarter", 18],
        ["Numeric", 19],
        ["OpenPunctuation", 20],
        ["PostfixNumeric", 21],
        ["PrefixNumeric", 22],
        ["Quotation", 23],
        ["ComplexContext", 24],
        ["Surrogate", 25],
        ["Space", 26],
        ["BreakSymbols", 27],
        ["ZwSpace", 28],
        ["NextLine", 29],
        ["WordJoiner", 30],
        ["H2", 31],
        ["H3", 32],
        ["Jl", 33],
        ["Jt", 34],
        ["Jv", 35],
        ["CloseParenthesis", 36],
        ["ConditionalJapaneseStarter", 37],
        ["HebrewLetter", 38],
        ["RegionalIndicator", 39],
        ["EBase", 40],
        ["EModifier", 41],
        ["Zwj", 42],
        ["Aksara", 43],
        ["AksaraPrebase", 44],
        ["AksaraStart", 45],
        ["ViramaFinal", 46],
        ["Virama", 47],
        ["UnambiguousHyphen", 48]
    ]);

    static getAllEntries() {
        return LineBreak.#values.entries();
    }

    #internalConstructor(value) {
        if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) {
            // We pass in two internalConstructor arguments to create *new*
            // instances of this type, otherwise the enums are treated as singletons.
            if (arguments[1] === diplomatRuntime.internalConstructor ) {
                this.#value = arguments[2];
                return this;
            }
            return LineBreak.#objectValues[arguments[1]];
        }

        if (value instanceof LineBreak) {
            return value;
        }

        let intVal = LineBreak.#values.get(value);

        // Nullish check, checks for null or undefined
        if (intVal != null) {
            return LineBreak.#objectValues[intVal];
        }

        throw TypeError(value + " is not a LineBreak and does not correspond to any of its enumerator values.");
    }

    /** @internal */
    static fromValue(value) {
        return new LineBreak(value);
    }

    get value(){
        return [...LineBreak.#values.keys()][this.#value];
    }

    /** @internal */
    get ffiValue(){
        return this.#value;
    }
    static #objectValues = [
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 5),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 6),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 7),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 8),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 9),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 10),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 11),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 12),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 13),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 14),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 15),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 16),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 17),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 18),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 19),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 20),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 21),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 22),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 23),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 24),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 25),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 26),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 27),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 28),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 29),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 30),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 31),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 32),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 33),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 34),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 35),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 36),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 37),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 38),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 39),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 40),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 41),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 42),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 43),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 44),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 45),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 46),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 47),
        new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 48),
    ];

    /**
     * See the [Rust documentation for `Unknown`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Unknown) for more information.
     */
    static Unknown = LineBreak.#objectValues[0];
    /**
     * See the [Rust documentation for `Ambiguous`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Ambiguous) for more information.
     */
    static Ambiguous = LineBreak.#objectValues[1];
    /**
     * See the [Rust documentation for `Alphabetic`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Alphabetic) for more information.
     */
    static Alphabetic = LineBreak.#objectValues[2];
    /**
     * See the [Rust documentation for `BreakBoth`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.BreakBoth) for more information.
     */
    static BreakBoth = LineBreak.#objectValues[3];
    /**
     * See the [Rust documentation for `BreakAfter`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.BreakAfter) for more information.
     */
    static BreakAfter = LineBreak.#objectValues[4];
    /**
     * See the [Rust documentation for `BreakBefore`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.BreakBefore) for more information.
     */
    static BreakBefore = LineBreak.#objectValues[5];
    /**
     * See the [Rust documentation for `MandatoryBreak`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.MandatoryBreak) for more information.
     */
    static MandatoryBreak = LineBreak.#objectValues[6];
    /**
     * See the [Rust documentation for `ContingentBreak`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ContingentBreak) for more information.
     */
    static ContingentBreak = LineBreak.#objectValues[7];
    /**
     * See the [Rust documentation for `ClosePunctuation`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ClosePunctuation) for more information.
     */
    static ClosePunctuation = LineBreak.#objectValues[8];
    /**
     * See the [Rust documentation for `CombiningMark`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.CombiningMark) for more information.
     */
    static CombiningMark = LineBreak.#objectValues[9];
    /**
     * See the [Rust documentation for `CarriageReturn`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.CarriageReturn) for more information.
     */
    static CarriageReturn = LineBreak.#objectValues[10];
    /**
     * See the [Rust documentation for `Exclamation`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Exclamation) for more information.
     */
    static Exclamation = LineBreak.#objectValues[11];
    /**
     * See the [Rust documentation for `Glue`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Glue) for more information.
     */
    static Glue = LineBreak.#objectValues[12];
    /**
     * See the [Rust documentation for `Hyphen`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Hyphen) for more information.
     */
    static Hyphen = LineBreak.#objectValues[13];
    /**
     * See the [Rust documentation for `Ideographic`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Ideographic) for more information.
     */
    static Ideographic = LineBreak.#objectValues[14];
    /**
     * See the [Rust documentation for `Inseparable`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Inseparable) for more information.
     */
    static Inseparable = LineBreak.#objectValues[15];
    /**
     * See the [Rust documentation for `InfixNumeric`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.InfixNumeric) for more information.
     */
    static InfixNumeric = LineBreak.#objectValues[16];
    /**
     * See the [Rust documentation for `LineFeed`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.LineFeed) for more information.
     */
    static LineFeed = LineBreak.#objectValues[17];
    /**
     * See the [Rust documentation for `Nonstarter`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Nonstarter) for more information.
     */
    static Nonstarter = LineBreak.#objectValues[18];
    /**
     * See the [Rust documentation for `Numeric`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Numeric) for more information.
     */
    static Numeric = LineBreak.#objectValues[19];
    /**
     * See the [Rust documentation for `OpenPunctuation`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.OpenPunctuation) for more information.
     */
    static OpenPunctuation = LineBreak.#objectValues[20];
    /**
     * See the [Rust documentation for `PostfixNumeric`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.PostfixNumeric) for more information.
     */
    static PostfixNumeric = LineBreak.#objectValues[21];
    /**
     * See the [Rust documentation for `PrefixNumeric`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.PrefixNumeric) for more information.
     */
    static PrefixNumeric = LineBreak.#objectValues[22];
    /**
     * See the [Rust documentation for `Quotation`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Quotation) for more information.
     */
    static Quotation = LineBreak.#objectValues[23];
    /**
     * See the [Rust documentation for `ComplexContext`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ComplexContext) for more information.
     */
    static ComplexContext = LineBreak.#objectValues[24];
    /**
     * See the [Rust documentation for `Surrogate`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Surrogate) for more information.
     */
    static Surrogate = LineBreak.#objectValues[25];
    /**
     * See the [Rust documentation for `Space`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Space) for more information.
     */
    static Space = LineBreak.#objectValues[26];
    /**
     * See the [Rust documentation for `BreakSymbols`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.BreakSymbols) for more information.
     */
    static BreakSymbols = LineBreak.#objectValues[27];
    /**
     * See the [Rust documentation for `ZWSpace`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ZWSpace) for more information.
     */
    static ZwSpace = LineBreak.#objectValues[28];
    /**
     * See the [Rust documentation for `NextLine`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.NextLine) for more information.
     */
    static NextLine = LineBreak.#objectValues[29];
    /**
     * See the [Rust documentation for `WordJoiner`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.WordJoiner) for more information.
     */
    static WordJoiner = LineBreak.#objectValues[30];
    /**
     * See the [Rust documentation for `H2`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.H2) for more information.
     */
    static H2 = LineBreak.#objectValues[31];
    /**
     * See the [Rust documentation for `H3`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.H3) for more information.
     */
    static H3 = LineBreak.#objectValues[32];
    /**
     * See the [Rust documentation for `JL`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.JL) for more information.
     */
    static Jl = LineBreak.#objectValues[33];
    /**
     * See the [Rust documentation for `JT`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.JT) for more information.
     */
    static Jt = LineBreak.#objectValues[34];
    /**
     * See the [Rust documentation for `JV`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.JV) for more information.
     */
    static Jv = LineBreak.#objectValues[35];
    /**
     * See the [Rust documentation for `CloseParenthesis`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.CloseParenthesis) for more information.
     */
    static CloseParenthesis = LineBreak.#objectValues[36];
    /**
     * See the [Rust documentation for `ConditionalJapaneseStarter`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ConditionalJapaneseStarter) for more information.
     */
    static ConditionalJapaneseStarter = LineBreak.#objectValues[37];
    /**
     * See the [Rust documentation for `HebrewLetter`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.HebrewLetter) for more information.
     */
    static HebrewLetter = LineBreak.#objectValues[38];
    /**
     * See the [Rust documentation for `RegionalIndicator`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.RegionalIndicator) for more information.
     */
    static RegionalIndicator = LineBreak.#objectValues[39];
    /**
     * See the [Rust documentation for `EBase`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.EBase) for more information.
     */
    static EBase = LineBreak.#objectValues[40];
    /**
     * See the [Rust documentation for `EModifier`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.EModifier) for more information.
     */
    static EModifier = LineBreak.#objectValues[41];
    /**
     * See the [Rust documentation for `ZWJ`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ZWJ) for more information.
     */
    static Zwj = LineBreak.#objectValues[42];
    /**
     * See the [Rust documentation for `Aksara`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Aksara) for more information.
     */
    static Aksara = LineBreak.#objectValues[43];
    /**
     * See the [Rust documentation for `AksaraPrebase`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.AksaraPrebase) for more information.
     */
    static AksaraPrebase = LineBreak.#objectValues[44];
    /**
     * See the [Rust documentation for `AksaraStart`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.AksaraStart) for more information.
     */
    static AksaraStart = LineBreak.#objectValues[45];
    /**
     * See the [Rust documentation for `ViramaFinal`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.ViramaFinal) for more information.
     */
    static ViramaFinal = LineBreak.#objectValues[46];
    /**
     * See the [Rust documentation for `Virama`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.Virama) for more information.
     */
    static Virama = LineBreak.#objectValues[47];
    /**
     * See the [Rust documentation for `UnambiguousHyphen`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#associatedconstant.UnambiguousHyphen) for more information.
     */
    static UnambiguousHyphen = LineBreak.#objectValues[48];


    /**
     * See the [Rust documentation for `for_char`](https://docs.rs/icu/2.2.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
     */
    static forChar(ch) {

        const result = wasm.icu4x_LineBreak_for_char_mv1(ch);

        try {
            return new LineBreak(diplomatRuntime.internalConstructor, result);
        }

        finally {
            diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
        }
    }

    /**
     * Get the "long" name of this property value (returns empty if property value is unknown)
     *
     * See the [Rust documentation for `get`](https://docs.rs/icu/2.2.0/icu/properties/struct.PropertyNamesLongBorrowed.html#method.get) for more information.
     */
    longName() {
        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 9, 4, true);


        const result = wasm.icu4x_LineBreak_long_name_mv1(diplomatReceive.buffer, this.ffiValue);

        try {
            if (!diplomatReceive.resultFlag) {
                return null;
            }
            return new diplomatRuntime.DiplomatSliceStr(wasm, diplomatReceive.buffer,  "string8", []).getValue();
        }

        finally {
            diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
            diplomatReceive.free();
        }
    }

    /**
     * Get the "short" name of this property value (returns empty if property value is unknown)
     *
     * See the [Rust documentation for `get`](https://docs.rs/icu/2.2.0/icu/properties/struct.PropertyNamesShortBorrowed.html#method.get) for more information.
     */
    shortName() {
        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 9, 4, true);


        const result = wasm.icu4x_LineBreak_short_name_mv1(diplomatReceive.buffer, this.ffiValue);

        try {
            if (!diplomatReceive.resultFlag) {
                return null;
            }
            return new diplomatRuntime.DiplomatSliceStr(wasm, diplomatReceive.buffer,  "string8", []).getValue();
        }

        finally {
            diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
            diplomatReceive.free();
        }
    }

    /**
     * Convert to an integer value usable with ICU4C and `CodePointMapData`
     *
     * See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#method.to_icu4c_value) for more information.
     */
    toIntegerValue() {

        const result = wasm.icu4x_LineBreak_to_integer_value_mv1(this.ffiValue);

        try {
            return result;
        }

        finally {
            diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
        }
    }

    /**
     * Convert from an integer value from ICU4C or `CodePointMapData`
     *
     * See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.LineBreak.html#method.from_icu4c_value) for more information.
     */
    static fromIntegerValue(other) {
        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);


        const result = wasm.icu4x_LineBreak_from_integer_value_mv1(diplomatReceive.buffer, other);

        try {
            if (!diplomatReceive.resultFlag) {
                return null;
            }
            return new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
        }

        finally {
            diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
            diplomatReceive.free();
        }
    }

    static tryFromStr(s) {
        let functionCleanupArena = new diplomatRuntime.CleanupArena();

        const sSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, s)));
        const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);


        const result = wasm.icu4x_LineBreak_try_from_str_mv1(diplomatReceive.buffer, sSlice.ptr);

        try {
            if (!diplomatReceive.resultFlag) {
                return null;
            }
            return new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
        }

        finally {
            diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
            functionCleanupArena.free();

            diplomatReceive.free();
        }
    }

    constructor(value) {
        return this.#internalConstructor(...arguments)
    }
}