@@ -789,6 +789,144 @@ extension PaginatorState: Equatable, Hashable {}
789
789
790
790
791
791
792
+ // Note that we don't yet support `indirect` for enums.
793
+ // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
794
+ /**
795
+ * The error type for failures while trying to log in a new device using a QR
796
+ * code.
797
+ */
798
+
799
+ public enum QrCodeLoginError {
800
+
801
+ /**
802
+ * An error happened while we were communicating with the OIDC provider.
803
+ */
804
+ case oidc
805
+ /**
806
+ * The other device has signaled to us that the login has failed.
807
+ */
808
+ case loginFailure
809
+ /**
810
+ * An unexpected message was received from the other device.
811
+ */
812
+ case unexpectedMessage
813
+ /**
814
+ * An error happened while exchanging messages with the other device.
815
+ */
816
+ case secureChannel
817
+ /**
818
+ * The cross-process refresh lock failed to be initialized.
819
+ */
820
+ case crossProcessRefreshLock
821
+ /**
822
+ * An error happened while we were trying to discover our user and device
823
+ * ID, after we have acquired an access token from the OIDC provider.
824
+ */
825
+ case userIdDiscovery
826
+ /**
827
+ * We failed to set the session tokens after we figured out our device and
828
+ * user IDs.
829
+ */
830
+ case sessionTokens
831
+ /**
832
+ * The device keys failed to be uploaded after we successfully logged in.
833
+ */
834
+ case deviceKeyUpload
835
+ /**
836
+ * The secrets bundle we received from the existing device failed to be
837
+ * imported.
838
+ */
839
+ case secretImport
840
+ }
841
+
842
+
843
+ public struct FfiConverterTypeQRCodeLoginError : FfiConverterRustBuffer {
844
+ typealias SwiftType = QrCodeLoginError
845
+
846
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> QrCodeLoginError {
847
+ let variant : Int32 = try readInt ( & buf)
848
+ switch variant {
849
+
850
+ case 1 : return . oidc
851
+
852
+ case 2 : return . loginFailure
853
+
854
+ case 3 : return . unexpectedMessage
855
+
856
+ case 4 : return . secureChannel
857
+
858
+ case 5 : return . crossProcessRefreshLock
859
+
860
+ case 6 : return . userIdDiscovery
861
+
862
+ case 7 : return . sessionTokens
863
+
864
+ case 8 : return . deviceKeyUpload
865
+
866
+ case 9 : return . secretImport
867
+
868
+ default : throw UniffiInternalError . unexpectedEnumCase
869
+ }
870
+ }
871
+
872
+ public static func write( _ value: QrCodeLoginError , into buf: inout [ UInt8 ] ) {
873
+ switch value {
874
+
875
+
876
+ case . oidc:
877
+ writeInt ( & buf, Int32 ( 1 ) )
878
+
879
+
880
+ case . loginFailure:
881
+ writeInt ( & buf, Int32 ( 2 ) )
882
+
883
+
884
+ case . unexpectedMessage:
885
+ writeInt ( & buf, Int32 ( 3 ) )
886
+
887
+
888
+ case . secureChannel:
889
+ writeInt ( & buf, Int32 ( 4 ) )
890
+
891
+
892
+ case . crossProcessRefreshLock:
893
+ writeInt ( & buf, Int32 ( 5 ) )
894
+
895
+
896
+ case . userIdDiscovery:
897
+ writeInt ( & buf, Int32 ( 6 ) )
898
+
899
+
900
+ case . sessionTokens:
901
+ writeInt ( & buf, Int32 ( 7 ) )
902
+
903
+
904
+ case . deviceKeyUpload:
905
+ writeInt ( & buf, Int32 ( 8 ) )
906
+
907
+
908
+ case . secretImport:
909
+ writeInt ( & buf, Int32 ( 9 ) )
910
+
911
+ }
912
+ }
913
+ }
914
+
915
+
916
+ public func FfiConverterTypeQRCodeLoginError_lift( _ buf: RustBuffer ) throws -> QrCodeLoginError {
917
+ return try FfiConverterTypeQRCodeLoginError . lift ( buf)
918
+ }
919
+
920
+ public func FfiConverterTypeQRCodeLoginError_lower( _ value: QrCodeLoginError ) -> RustBuffer {
921
+ return FfiConverterTypeQRCodeLoginError . lower ( value)
922
+ }
923
+
924
+
925
+
926
+ extension QrCodeLoginError : Equatable , Hashable { }
927
+
928
+
929
+
792
930
// Note that we don't yet support `indirect` for enums.
793
931
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
794
932
/**
0 commit comments