33
44@file:Suppress(" NAME_SHADOWING" )
55
6- package uniffi.vss_rust_client_ffi
6+ package uniffi.vss_rust_client_ffi ;
77
88// Common helper code.
99//
@@ -51,8 +51,8 @@ open class RustBuffer : Structure() {
5151 _UniFFILib .INSTANCE .ffi_vss_rust_client_ffi_rustbuffer_alloc(size, status)
5252 }.also {
5353 if (it.data == null ) {
54- throw RuntimeException (" RustBuffer.alloc() returned null data pointer (size=${size} )" )
55- }
54+ throw RuntimeException (" RustBuffer.alloc() returned null data pointer (size=${size} )" )
55+ }
5656 }
5757
5858 internal fun create (capacity : Int , len : Int , data : Pointer ? ): RustBuffer .ByValue {
@@ -175,11 +175,11 @@ public interface FfiConverter<KotlinType, FfiType> {
175175 fun liftFromRustBuffer (rbuf : RustBuffer .ByValue ): KotlinType {
176176 val byteBuf = rbuf.asByteBuffer()!!
177177 try {
178- val item = read(byteBuf)
179- if (byteBuf.hasRemaining()) {
180- throw RuntimeException (" junk remaining in buffer after lifting, something is very wrong!!" )
181- }
182- return item
178+ val item = read(byteBuf)
179+ if (byteBuf.hasRemaining()) {
180+ throw RuntimeException (" junk remaining in buffer after lifting, something is very wrong!!" )
181+ }
182+ return item
183183 } finally {
184184 RustBuffer .free(rbuf)
185185 }
@@ -377,10 +377,10 @@ internal interface _UniFFILib : Library {
377377 companion object {
378378 internal val INSTANCE : _UniFFILib by lazy {
379379 loadIndirect<_UniFFILib >(componentName = " vss_rust_client_ffi" )
380- .also { lib: _UniFFILib ->
381- uniffiCheckContractApiVersion(lib)
382- uniffiCheckApiChecksums(lib)
383- uniffiRustFutureContinuationCallback.register(lib)
380+ .also { lib: _UniFFILib ->
381+ uniffiCheckContractApiVersion(lib)
382+ uniffiCheckApiChecksums(lib)
383+ uniffiRustFutureContinuationCallback.register(lib)
384384 }
385385 }
386386 }
@@ -753,13 +753,13 @@ public object FfiConverterTypeKeyValue: FfiConverterRustBuffer<KeyValue> {
753753 }
754754
755755 override fun allocationSize (value : KeyValue ) = (
756- FfiConverterString .allocationSize(value.`key`) +
756+ FfiConverterString .allocationSize(value.`key`) +
757757 FfiConverterByteArray .allocationSize(value.`value`)
758- )
758+ )
759759
760760 override fun write (value : KeyValue , buf : ByteBuffer ) {
761- FfiConverterString .write(value.`key`, buf)
762- FfiConverterByteArray .write(value.`value`, buf)
761+ FfiConverterString .write(value.`key`, buf)
762+ FfiConverterByteArray .write(value.`value`, buf)
763763 }
764764}
765765
@@ -783,13 +783,13 @@ public object FfiConverterTypeKeyVersion: FfiConverterRustBuffer<KeyVersion> {
783783 }
784784
785785 override fun allocationSize (value : KeyVersion ) = (
786- FfiConverterString .allocationSize(value.`key`) +
786+ FfiConverterString .allocationSize(value.`key`) +
787787 FfiConverterLong .allocationSize(value.`version`)
788- )
788+ )
789789
790790 override fun write (value : KeyVersion , buf : ByteBuffer ) {
791- FfiConverterString .write(value.`key`, buf)
792- FfiConverterLong .write(value.`version`, buf)
791+ FfiConverterString .write(value.`key`, buf)
792+ FfiConverterLong .write(value.`version`, buf)
793793 }
794794}
795795
@@ -811,11 +811,11 @@ public object FfiConverterTypeListKeyVersionsResponse: FfiConverterRustBuffer<Li
811811 }
812812
813813 override fun allocationSize (value : ListKeyVersionsResponse ) = (
814- FfiConverterSequenceTypeKeyVersion .allocationSize(value.`keyVersions`)
815- )
814+ FfiConverterSequenceTypeKeyVersion .allocationSize(value.`keyVersions`)
815+ )
816816
817817 override fun write (value : ListKeyVersionsResponse , buf : ByteBuffer ) {
818- FfiConverterSequenceTypeKeyVersion .write(value.`keyVersions`, buf)
818+ FfiConverterSequenceTypeKeyVersion .write(value.`keyVersions`, buf)
819819 }
820820}
821821
@@ -841,15 +841,15 @@ public object FfiConverterTypeVssItem: FfiConverterRustBuffer<VssItem> {
841841 }
842842
843843 override fun allocationSize (value : VssItem ) = (
844- FfiConverterString .allocationSize(value.`key`) +
844+ FfiConverterString .allocationSize(value.`key`) +
845845 FfiConverterByteArray .allocationSize(value.`value`) +
846846 FfiConverterLong .allocationSize(value.`version`)
847- )
847+ )
848848
849849 override fun write (value : VssItem , buf : ByteBuffer ) {
850- FfiConverterString .write(value.`key`, buf)
851- FfiConverterByteArray .write(value.`value`, buf)
852- FfiConverterLong .write(value.`version`, buf)
850+ FfiConverterString .write(value.`key`, buf)
851+ FfiConverterByteArray .write(value.`value`, buf)
852+ FfiConverterLong .write(value.`version`, buf)
853853 }
854854}
855855
@@ -862,70 +862,70 @@ sealed class VssException: Exception() {
862862
863863 class ConnectionException (
864864 val `errorDetails`: String
865- ) : VssException() {
865+ ) : VssException() {
866866 override val message
867867 get() = " errorDetails=${ `errorDetails` } "
868868 }
869869
870870 class AuthException (
871871 val `errorDetails`: String
872- ) : VssException() {
872+ ) : VssException() {
873873 override val message
874874 get() = " errorDetails=${ `errorDetails` } "
875875 }
876876
877877 class StoreException (
878878 val `errorDetails`: String
879- ) : VssException() {
879+ ) : VssException() {
880880 override val message
881881 get() = " errorDetails=${ `errorDetails` } "
882882 }
883883
884884 class GetException (
885885 val `errorDetails`: String
886- ) : VssException() {
886+ ) : VssException() {
887887 override val message
888888 get() = " errorDetails=${ `errorDetails` } "
889889 }
890890
891891 class ListException (
892892 val `errorDetails`: String
893- ) : VssException() {
893+ ) : VssException() {
894894 override val message
895895 get() = " errorDetails=${ `errorDetails` } "
896896 }
897897
898898 class PutException (
899899 val `errorDetails`: String
900- ) : VssException() {
900+ ) : VssException() {
901901 override val message
902902 get() = " errorDetails=${ `errorDetails` } "
903903 }
904904
905905 class DeleteException (
906906 val `errorDetails`: String
907- ) : VssException() {
907+ ) : VssException() {
908908 override val message
909909 get() = " errorDetails=${ `errorDetails` } "
910910 }
911911
912912 class InvalidData (
913913 val `errorDetails`: String
914- ) : VssException() {
914+ ) : VssException() {
915915 override val message
916916 get() = " errorDetails=${ `errorDetails` } "
917917 }
918918
919919 class NetworkException (
920920 val `errorDetails`: String
921- ) : VssException() {
921+ ) : VssException() {
922922 override val message
923923 get() = " errorDetails=${ `errorDetails` } "
924924 }
925925
926926 class UnknownException (
927927 val `errorDetails`: String
928- ) : VssException() {
928+ ) : VssException() {
929929 override val message
930930 get() = " errorDetails=${ `errorDetails` } "
931931 }
@@ -945,34 +945,34 @@ public object FfiConverterTypeVssError : FfiConverterRustBuffer<VssException> {
945945 return when (buf.getInt()) {
946946 1 -> VssException .ConnectionException (
947947 FfiConverterString .read(buf),
948- )
948+ )
949949 2 -> VssException .AuthException (
950950 FfiConverterString .read(buf),
951- )
951+ )
952952 3 -> VssException .StoreException (
953953 FfiConverterString .read(buf),
954- )
954+ )
955955 4 -> VssException .GetException (
956956 FfiConverterString .read(buf),
957- )
957+ )
958958 5 -> VssException .ListException (
959959 FfiConverterString .read(buf),
960- )
960+ )
961961 6 -> VssException .PutException (
962962 FfiConverterString .read(buf),
963- )
963+ )
964964 7 -> VssException .DeleteException (
965965 FfiConverterString .read(buf),
966- )
966+ )
967967 8 -> VssException .InvalidData (
968968 FfiConverterString .read(buf),
969- )
969+ )
970970 9 -> VssException .NetworkException (
971971 FfiConverterString .read(buf),
972- )
972+ )
973973 10 -> VssException .UnknownException (
974974 FfiConverterString .read(buf),
975- )
975+ )
976976 else -> throw RuntimeException (" invalid error enum value, something is very wrong!!" )
977977 }
978978 }
@@ -982,53 +982,53 @@ public object FfiConverterTypeVssError : FfiConverterRustBuffer<VssException> {
982982 is VssException .ConnectionException -> (
983983 // Add the size for the Int that specifies the variant plus the size needed for all fields
984984 4
985- + FfiConverterString .allocationSize(value.`errorDetails`)
986- )
985+ + FfiConverterString .allocationSize(value.`errorDetails`)
986+ )
987987 is VssException .AuthException -> (
988988 // Add the size for the Int that specifies the variant plus the size needed for all fields
989989 4
990- + FfiConverterString .allocationSize(value.`errorDetails`)
991- )
990+ + FfiConverterString .allocationSize(value.`errorDetails`)
991+ )
992992 is VssException .StoreException -> (
993993 // Add the size for the Int that specifies the variant plus the size needed for all fields
994994 4
995- + FfiConverterString .allocationSize(value.`errorDetails`)
996- )
995+ + FfiConverterString .allocationSize(value.`errorDetails`)
996+ )
997997 is VssException .GetException -> (
998998 // Add the size for the Int that specifies the variant plus the size needed for all fields
999999 4
1000- + FfiConverterString .allocationSize(value.`errorDetails`)
1001- )
1000+ + FfiConverterString .allocationSize(value.`errorDetails`)
1001+ )
10021002 is VssException .ListException -> (
10031003 // Add the size for the Int that specifies the variant plus the size needed for all fields
10041004 4
1005- + FfiConverterString .allocationSize(value.`errorDetails`)
1006- )
1005+ + FfiConverterString .allocationSize(value.`errorDetails`)
1006+ )
10071007 is VssException .PutException -> (
10081008 // Add the size for the Int that specifies the variant plus the size needed for all fields
10091009 4
1010- + FfiConverterString .allocationSize(value.`errorDetails`)
1011- )
1010+ + FfiConverterString .allocationSize(value.`errorDetails`)
1011+ )
10121012 is VssException .DeleteException -> (
10131013 // Add the size for the Int that specifies the variant plus the size needed for all fields
10141014 4
1015- + FfiConverterString .allocationSize(value.`errorDetails`)
1016- )
1015+ + FfiConverterString .allocationSize(value.`errorDetails`)
1016+ )
10171017 is VssException .InvalidData -> (
10181018 // Add the size for the Int that specifies the variant plus the size needed for all fields
10191019 4
1020- + FfiConverterString .allocationSize(value.`errorDetails`)
1021- )
1020+ + FfiConverterString .allocationSize(value.`errorDetails`)
1021+ )
10221022 is VssException .NetworkException -> (
10231023 // Add the size for the Int that specifies the variant plus the size needed for all fields
10241024 4
1025- + FfiConverterString .allocationSize(value.`errorDetails`)
1026- )
1025+ + FfiConverterString .allocationSize(value.`errorDetails`)
1026+ )
10271027 is VssException .UnknownException -> (
10281028 // Add the size for the Int that specifies the variant plus the size needed for all fields
10291029 4
1030- + FfiConverterString .allocationSize(value.`errorDetails`)
1031- )
1030+ + FfiConverterString .allocationSize(value.`errorDetails`)
1031+ )
10321032 }
10331033 }
10341034
@@ -1344,8 +1344,8 @@ suspend fun `vssPutWithKeyPrefix`(`items`: List<KeyValue>) : List<VssItem> {
13441344fun `vssShutdownClient` () =
13451345
13461346 rustCall() { _status ->
1347- _UniFFILib .INSTANCE .uniffi_vss_rust_client_ffi_fn_func_vss_shutdown_client(_status )
1348- }
1347+ _UniFFILib .INSTANCE .uniffi_vss_rust_client_ffi_fn_func_vss_shutdown_client(_status )
1348+ }
13491349
13501350
13511351@Throws(VssException ::class )
0 commit comments