@@ -297,6 +297,19 @@ private func uniffiCheckCallStatus(
297297// Public interface members begin here.
298298
299299
300+ fileprivate  struct  FfiConverterInt64 :  FfiConverterPrimitive  { 
301+     typealias  FfiType  =  Int64 
302+     typealias  SwiftType  =  Int64 
303+ 
304+     public  static  func  read( from buf:  inout  ( data:  Data ,  offset:  Data . Index ) )  throws  ->  Int64  { 
305+         return  try   lift ( readInt ( & buf) ) 
306+     } 
307+ 
308+     public  static  func  write( _ value:  Int64 ,  into buf:  inout  [ UInt8 ] )  { 
309+         writeInt ( & buf,  lower ( value) ) 
310+     } 
311+ } 
312+ 
300313fileprivate  struct  FfiConverterString :  FfiConverter  { 
301314    typealias  SwiftType  =  String 
302315    typealias  FfiType  =  RustBuffer 
@@ -335,6 +348,201 @@ fileprivate struct FfiConverterString: FfiConverter {
335348    } 
336349} 
337350
351+ 
352+ /**
353+  * A set of common power levels required for various operations within a room,
354+  * that can be applied as a single operation. When updating these
355+  * settings, any levels that are `None` will remain unchanged.
356+  */
357+ public  struct  RoomPowerLevelChanges  { 
358+     /**
359+      * The level required to ban a user.
360+      */
361+     public  var  ban :  Int64 ? 
362+     /**
363+      * The level required to invite a user.
364+      */
365+     public  var  invite :  Int64 ? 
366+     /**
367+      * The level required to kick a user.
368+      */
369+     public  var  kick :  Int64 ? 
370+     /**
371+      * The level required to redact an event.
372+      */
373+     public  var  redact :  Int64 ? 
374+     /**
375+      * The default level required to send message events.
376+      */
377+     public  var  eventsDefault :  Int64 ? 
378+     /**
379+      * The default level required to send state events.
380+      */
381+     public  var  stateDefault :  Int64 ? 
382+     /**
383+      * The default power level for every user in the room.
384+      */
385+     public  var  usersDefault :  Int64 ? 
386+     /**
387+      * The level required to change the room's name.
388+      */
389+     public  var  roomName :  Int64 ? 
390+     /**
391+      * The level required to change the room's avatar.
392+      */
393+     public  var  roomAvatar :  Int64 ? 
394+     /**
395+      * The level required to change the room's topic.
396+      */
397+     public  var  roomTopic :  Int64 ? 
398+ 
399+     // Default memberwise initializers are never public by default, so we
400+     // declare one manually.
401+     public  init ( 
402+         /**
403+          * The level required to ban a user.
404+          */
405+         ban:  Int64 ?   =  nil ,  
406+         /**
407+          * The level required to invite a user.
408+          */
409+         invite:  Int64 ?   =  nil ,  
410+         /**
411+          * The level required to kick a user.
412+          */
413+         kick:  Int64 ?   =  nil ,  
414+         /**
415+          * The level required to redact an event.
416+          */
417+         redact:  Int64 ?   =  nil ,  
418+         /**
419+          * The default level required to send message events.
420+          */
421+         eventsDefault:  Int64 ?   =  nil ,  
422+         /**
423+          * The default level required to send state events.
424+          */
425+         stateDefault:  Int64 ?   =  nil ,  
426+         /**
427+          * The default power level for every user in the room.
428+          */
429+         usersDefault:  Int64 ?   =  nil ,  
430+         /**
431+          * The level required to change the room's name.
432+          */
433+         roomName:  Int64 ?   =  nil ,  
434+         /**
435+          * The level required to change the room's avatar.
436+          */
437+         roomAvatar:  Int64 ?   =  nil ,  
438+         /**
439+          * The level required to change the room's topic.
440+          */
441+         roomTopic:  Int64 ?   =  nil )  { 
442+         self . ban =  ban
443+         self . invite =  invite
444+         self . kick =  kick
445+         self . redact =  redact
446+         self . eventsDefault =  eventsDefault
447+         self . stateDefault =  stateDefault
448+         self . usersDefault =  usersDefault
449+         self . roomName =  roomName
450+         self . roomAvatar =  roomAvatar
451+         self . roomTopic =  roomTopic
452+     } 
453+ } 
454+ 
455+ 
456+ extension  RoomPowerLevelChanges :  Equatable ,  Hashable  { 
457+     public  static  func  == ( lhs:  RoomPowerLevelChanges ,  rhs:  RoomPowerLevelChanges )  ->  Bool  { 
458+         if  lhs. ban !=  rhs. ban { 
459+             return  false 
460+         } 
461+         if  lhs. invite !=  rhs. invite { 
462+             return  false 
463+         } 
464+         if  lhs. kick !=  rhs. kick { 
465+             return  false 
466+         } 
467+         if  lhs. redact !=  rhs. redact { 
468+             return  false 
469+         } 
470+         if  lhs. eventsDefault !=  rhs. eventsDefault { 
471+             return  false 
472+         } 
473+         if  lhs. stateDefault !=  rhs. stateDefault { 
474+             return  false 
475+         } 
476+         if  lhs. usersDefault !=  rhs. usersDefault { 
477+             return  false 
478+         } 
479+         if  lhs. roomName !=  rhs. roomName { 
480+             return  false 
481+         } 
482+         if  lhs. roomAvatar !=  rhs. roomAvatar { 
483+             return  false 
484+         } 
485+         if  lhs. roomTopic !=  rhs. roomTopic { 
486+             return  false 
487+         } 
488+         return  true 
489+     } 
490+ 
491+     public  func  hash( into hasher:  inout  Hasher )  { 
492+         hasher. combine ( ban) 
493+         hasher. combine ( invite) 
494+         hasher. combine ( kick) 
495+         hasher. combine ( redact) 
496+         hasher. combine ( eventsDefault) 
497+         hasher. combine ( stateDefault) 
498+         hasher. combine ( usersDefault) 
499+         hasher. combine ( roomName) 
500+         hasher. combine ( roomAvatar) 
501+         hasher. combine ( roomTopic) 
502+     } 
503+ } 
504+ 
505+ 
506+ public  struct  FfiConverterTypeRoomPowerLevelChanges :  FfiConverterRustBuffer  { 
507+     public  static  func  read( from buf:  inout  ( data:  Data ,  offset:  Data . Index ) )  throws  ->  RoomPowerLevelChanges  { 
508+         return 
509+             try   RoomPowerLevelChanges ( 
510+                 ban:  FfiConverterOptionInt64 . read ( from:  & buf) ,  
511+                 invite:  FfiConverterOptionInt64 . read ( from:  & buf) ,  
512+                 kick:  FfiConverterOptionInt64 . read ( from:  & buf) ,  
513+                 redact:  FfiConverterOptionInt64 . read ( from:  & buf) ,  
514+                 eventsDefault:  FfiConverterOptionInt64 . read ( from:  & buf) ,  
515+                 stateDefault:  FfiConverterOptionInt64 . read ( from:  & buf) ,  
516+                 usersDefault:  FfiConverterOptionInt64 . read ( from:  & buf) ,  
517+                 roomName:  FfiConverterOptionInt64 . read ( from:  & buf) ,  
518+                 roomAvatar:  FfiConverterOptionInt64 . read ( from:  & buf) ,  
519+                 roomTopic:  FfiConverterOptionInt64 . read ( from:  & buf) 
520+         ) 
521+     } 
522+ 
523+     public  static  func  write( _ value:  RoomPowerLevelChanges ,  into buf:  inout  [ UInt8 ] )  { 
524+         FfiConverterOptionInt64 . write ( value. ban,  into:  & buf) 
525+         FfiConverterOptionInt64 . write ( value. invite,  into:  & buf) 
526+         FfiConverterOptionInt64 . write ( value. kick,  into:  & buf) 
527+         FfiConverterOptionInt64 . write ( value. redact,  into:  & buf) 
528+         FfiConverterOptionInt64 . write ( value. eventsDefault,  into:  & buf) 
529+         FfiConverterOptionInt64 . write ( value. stateDefault,  into:  & buf) 
530+         FfiConverterOptionInt64 . write ( value. usersDefault,  into:  & buf) 
531+         FfiConverterOptionInt64 . write ( value. roomName,  into:  & buf) 
532+         FfiConverterOptionInt64 . write ( value. roomAvatar,  into:  & buf) 
533+         FfiConverterOptionInt64 . write ( value. roomTopic,  into:  & buf) 
534+     } 
535+ } 
536+ 
537+ 
538+ public  func  FfiConverterTypeRoomPowerLevelChanges_lift( _ buf:  RustBuffer )  throws  ->  RoomPowerLevelChanges  { 
539+     return  try   FfiConverterTypeRoomPowerLevelChanges . lift ( buf) 
540+ } 
541+ 
542+ public  func  FfiConverterTypeRoomPowerLevelChanges_lower( _ value:  RoomPowerLevelChanges )  ->  RustBuffer  { 
543+     return  FfiConverterTypeRoomPowerLevelChanges . lower ( value) 
544+ } 
545+ 
338546// Note that we don't yet support `indirect` for enums.
339547// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
340548/**
@@ -406,6 +614,27 @@ extension RoomMemberRole: Equatable, Hashable {}
406614
407615
408616
617+ fileprivate  struct  FfiConverterOptionInt64 :  FfiConverterRustBuffer  { 
618+     typealias  SwiftType  =  Int64 ? 
619+ 
620+     public  static  func  write( _ value:  SwiftType ,  into buf:  inout  [ UInt8 ] )  { 
621+         guard  let  value =  value else  { 
622+             writeInt ( & buf,  Int8 ( 0 ) ) 
623+             return 
624+         } 
625+         writeInt ( & buf,  Int8 ( 1 ) ) 
626+         FfiConverterInt64 . write ( value,  into:  & buf) 
627+     } 
628+ 
629+     public  static  func  read( from buf:  inout  ( data:  Data ,  offset:  Data . Index ) )  throws  ->  SwiftType  { 
630+         switch  try   readInt ( & buf)  as  Int8  { 
631+         case  0 :  return  nil 
632+         case  1 :  return  try   FfiConverterInt64 . read ( from:  & buf) 
633+         default :  throw  UniffiInternalError . unexpectedOptionalTag
634+         } 
635+     } 
636+ } 
637+ 
409638private  enum  InitializationResult  { 
410639    case  ok
411640    case  contractVersionMismatch
0 commit comments