@@ -704,6 +704,91 @@ extension BackupDownloadStrategy: Equatable, Hashable {}
704704
705705
706706
707+ // Note that we don't yet support `indirect` for enums.
708+ // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
709+ /**
710+ * Current state of a [`Paginator`].
711+ */
712+
713+ public enum PaginatorState {
714+
715+ /**
716+ * The initial state of the paginator.
717+ */
718+ case initial
719+ /**
720+ * The paginator is fetching the target initial event.
721+ */
722+ case fetchingTargetEvent
723+ /**
724+ * The target initial event could be found, zero or more paginations have
725+ * happened since then, and the paginator is at rest now.
726+ */
727+ case idle
728+ /**
729+ * The paginator is… paginating one direction or another.
730+ */
731+ case paginating
732+ }
733+
734+
735+ public struct FfiConverterTypePaginatorState : FfiConverterRustBuffer {
736+ typealias SwiftType = PaginatorState
737+
738+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> PaginatorState {
739+ let variant : Int32 = try readInt ( & buf)
740+ switch variant {
741+
742+ case 1 : return . initial
743+
744+ case 2 : return . fetchingTargetEvent
745+
746+ case 3 : return . idle
747+
748+ case 4 : return . paginating
749+
750+ default : throw UniffiInternalError . unexpectedEnumCase
751+ }
752+ }
753+
754+ public static func write( _ value: PaginatorState , into buf: inout [ UInt8 ] ) {
755+ switch value {
756+
757+
758+ case . initial:
759+ writeInt ( & buf, Int32 ( 1 ) )
760+
761+
762+ case . fetchingTargetEvent:
763+ writeInt ( & buf, Int32 ( 2 ) )
764+
765+
766+ case . idle:
767+ writeInt ( & buf, Int32 ( 3 ) )
768+
769+
770+ case . paginating:
771+ writeInt ( & buf, Int32 ( 4 ) )
772+
773+ }
774+ }
775+ }
776+
777+
778+ public func FfiConverterTypePaginatorState_lift( _ buf: RustBuffer ) throws -> PaginatorState {
779+ return try FfiConverterTypePaginatorState . lift ( buf)
780+ }
781+
782+ public func FfiConverterTypePaginatorState_lower( _ value: PaginatorState ) -> RustBuffer {
783+ return FfiConverterTypePaginatorState . lower ( value)
784+ }
785+
786+
787+
788+ extension PaginatorState : Equatable , Hashable { }
789+
790+
791+
707792// Note that we don't yet support `indirect` for enums.
708793// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
709794/**
0 commit comments