Debian Codegraph @

third_party/rust/uniffi_bindgen/src/bindings/kotlin/templates/UInt16Helper.kt

raw
1 /**
2 * @suppress
3 */
4 public object FfiConverterUShort: FfiConverter<UShort, Short> {
5 override fun lift(value: Short): UShort {
6 return value.toUShort()
7 }
8
9 override fun read(buf: ByteBuffer): UShort {
10 return lift(buf.getShort())
11 }
12
13 override fun lower(value: UShort): Short {
14 return value.toShort()
15 }
16
17 override fun allocationSize(value: UShort) = 2UL
18
19 override fun write(value: UShort, buf: ByteBuffer) {
20 buf.putShort(value.toShort())
21 }
22 }