diff options
Diffstat (limited to '')
-rw-r--r-- | third_party/rust/uniffi-example-rondpoint/src/rondpoint.udl | 146 |
1 files changed, 146 insertions, 0 deletions
diff --git a/third_party/rust/uniffi-example-rondpoint/src/rondpoint.udl b/third_party/rust/uniffi-example-rondpoint/src/rondpoint.udl new file mode 100644 index 0000000000..05b1bfe825 --- /dev/null +++ b/third_party/rust/uniffi-example-rondpoint/src/rondpoint.udl @@ -0,0 +1,146 @@ +namespace rondpoint { + Dictionnaire copie_dictionnaire(Dictionnaire d); + Enumeration copie_enumeration(Enumeration e); + sequence<Enumeration> copie_enumerations(sequence<Enumeration> e); + record<DOMString, EnumerationAvecDonnees> copie_carte(record<DOMString, EnumerationAvecDonnees> c); + boolean switcheroo(boolean b); +}; + +dictionary minusculeMAJUSCULEDict { + boolean minusculeMAJUSCULEField; +}; + +enum minusculeMAJUSCULEEnum { + "minusculeMAJUSCULEVariant", +}; + +enum Enumeration { + "Un", + "Deux", + "Trois", +}; + +[Enum] +interface EnumerationAvecDonnees { + Zero(); + Un(u32 premier); + Deux(u32 premier, string second); +}; + +dictionary Dictionnaire { + Enumeration un; + boolean deux; + u8 petit_nombre; + u64 gros_nombre; +}; + +dictionary DictionnaireNombres { + u8 petit_nombre; + u16 court_nombre; + u32 nombre_simple; + u64 gros_nombre; +}; + +dictionary DictionnaireNombresSignes { + i8 petit_nombre; + i16 court_nombre; + i32 nombre_simple; + i64 gros_nombre; +}; + +interface Retourneur { + constructor(); + i8 identique_i8(i8 value); + u8 identique_u8(u8 value); + i16 identique_i16(i16 value); + u16 identique_u16(u16 value); + i32 identique_i32(i32 value); + u32 identique_u32(u32 value); + i64 identique_i64(i64 value); + u64 identique_u64(u64 value); + float identique_float(float value); + double identique_double(double value); + boolean identique_boolean(boolean value); + string identique_string(string value); + + DictionnaireNombresSignes identique_nombres_signes(DictionnaireNombresSignes value); + DictionnaireNombres identique_nombres(DictionnaireNombres value); + OptionneurDictionnaire identique_optionneur_dictionnaire(OptionneurDictionnaire value); +}; + +interface Stringifier { + constructor(); + string well_known_string(string value); + + string to_string_i8(i8 value); + string to_string_u8(u8 value); + string to_string_i16(i16 value); + string to_string_u16(u16 value); + string to_string_i32(i32 value); + string to_string_u32(u32 value); + string to_string_i64(i64 value); + string to_string_u64(u64 value); + string to_string_float(float value); + string to_string_double(double value); + string to_string_boolean(boolean value); +}; + +interface Optionneur { + constructor(); + boolean sinon_boolean(optional boolean value = false); + string sinon_string(optional string value = "default"); + + sequence<string> sinon_sequence(optional sequence<string> value = []); + + // Either sides of nullable. + string? sinon_null(optional string? value = null); + i32? sinon_zero(optional i32? value = 0); + + // Decimal integers, all 42. + u8 sinon_u8_dec(optional u8 value = 42); + i8 sinon_i8_dec(optional i8 value = -42); + u16 sinon_u16_dec(optional u16 value = 42); + i16 sinon_i16_dec(optional i16 value = 42); + u32 sinon_u32_dec(optional u32 value = 42); + i32 sinon_i32_dec(optional i32 value = 42); + u64 sinon_u64_dec(optional u64 value = 42); + i64 sinon_i64_dec(optional i64 value = 42); + + // Hexadecimal, including negatgives. + u8 sinon_u8_hex(optional u8 value = 0xff); + i8 sinon_i8_hex(optional i8 value = -0x7f); + u16 sinon_u16_hex(optional u16 value = 0xffff); + i16 sinon_i16_hex(optional i16 value = 0x7f); + u32 sinon_u32_hex(optional u32 value = 0xffffffff); + i32 sinon_i32_hex(optional i32 value = 0x7fffffff); + u64 sinon_u64_hex(optional u64 value = 0xffffffffffffffff); + i64 sinon_i64_hex(optional i64 value = 0x7fffffffffffffff); + + // Octal, FWIW. + u32 sinon_u32_oct(optional u32 value = 0755); + + // Floats + f32 sinon_f32(optional f32 value = 42.0); + f64 sinon_f64(optional f64 value = 42.1); + + // Enums, which we have to treat as strings in the UDL frontend. + Enumeration sinon_enum(optional Enumeration value = "Trois"); +}; + +dictionary OptionneurDictionnaire { + i8 i8_var = -8; + u8 u8_var = 8; + i16 i16_var = -0x10; + u16 u16_var = 0x10; + i32 i32_var = -32; + u32 u32_var = 32; + i64 i64_var = -64; + u64 u64_var = 64; + float float_var = 4.0; + double double_var = 8.0; + boolean boolean_var = true; + string string_var = "default"; + sequence<string> list_var = []; + Enumeration enumeration_var = "DEUX"; + minusculeMAJUSCULEEnum? dictionnaire_var = null; +}; |