/ app / lib / src / rust / transport / dht.freezed.dart
dht.freezed.dart
  1  // coverage:ignore-file
  2  // GENERATED CODE - DO NOT MODIFY BY HAND
  3  // ignore_for_file: type=lint
  4  // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
  5  
  6  part of 'dht.dart';
  7  
  8  // **************************************************************************
  9  // FreezedGenerator
 10  // **************************************************************************
 11  
 12  T _$identity<T>(T value) => value;
 13  
 14  final _privateConstructorUsedError = UnsupportedError(
 15    'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
 16  );
 17  
 18  /// @nodoc
 19  mixin _$DhtState {
 20    @optionalTypeArgs
 21    TResult when<TResult extends Object?>({
 22      required TResult Function() disconnected,
 23      required TResult Function() bootstrapping,
 24      required TResult Function(BigInt peerCount) connected,
 25      required TResult Function(String error) failed,
 26    }) => throw _privateConstructorUsedError;
 27    @optionalTypeArgs
 28    TResult? whenOrNull<TResult extends Object?>({
 29      TResult? Function()? disconnected,
 30      TResult? Function()? bootstrapping,
 31      TResult? Function(BigInt peerCount)? connected,
 32      TResult? Function(String error)? failed,
 33    }) => throw _privateConstructorUsedError;
 34    @optionalTypeArgs
 35    TResult maybeWhen<TResult extends Object?>({
 36      TResult Function()? disconnected,
 37      TResult Function()? bootstrapping,
 38      TResult Function(BigInt peerCount)? connected,
 39      TResult Function(String error)? failed,
 40      required TResult orElse(),
 41    }) => throw _privateConstructorUsedError;
 42    @optionalTypeArgs
 43    TResult map<TResult extends Object?>({
 44      required TResult Function(DhtState_Disconnected value) disconnected,
 45      required TResult Function(DhtState_Bootstrapping value) bootstrapping,
 46      required TResult Function(DhtState_Connected value) connected,
 47      required TResult Function(DhtState_Failed value) failed,
 48    }) => throw _privateConstructorUsedError;
 49    @optionalTypeArgs
 50    TResult? mapOrNull<TResult extends Object?>({
 51      TResult? Function(DhtState_Disconnected value)? disconnected,
 52      TResult? Function(DhtState_Bootstrapping value)? bootstrapping,
 53      TResult? Function(DhtState_Connected value)? connected,
 54      TResult? Function(DhtState_Failed value)? failed,
 55    }) => throw _privateConstructorUsedError;
 56    @optionalTypeArgs
 57    TResult maybeMap<TResult extends Object?>({
 58      TResult Function(DhtState_Disconnected value)? disconnected,
 59      TResult Function(DhtState_Bootstrapping value)? bootstrapping,
 60      TResult Function(DhtState_Connected value)? connected,
 61      TResult Function(DhtState_Failed value)? failed,
 62      required TResult orElse(),
 63    }) => throw _privateConstructorUsedError;
 64  }
 65  
 66  /// @nodoc
 67  abstract class $DhtStateCopyWith<$Res> {
 68    factory $DhtStateCopyWith(DhtState value, $Res Function(DhtState) then) =
 69        _$DhtStateCopyWithImpl<$Res, DhtState>;
 70  }
 71  
 72  /// @nodoc
 73  class _$DhtStateCopyWithImpl<$Res, $Val extends DhtState>
 74      implements $DhtStateCopyWith<$Res> {
 75    _$DhtStateCopyWithImpl(this._value, this._then);
 76  
 77    // ignore: unused_field
 78    final $Val _value;
 79    // ignore: unused_field
 80    final $Res Function($Val) _then;
 81  
 82    /// Create a copy of DhtState
 83    /// with the given fields replaced by the non-null parameter values.
 84  }
 85  
 86  /// @nodoc
 87  abstract class _$$DhtState_DisconnectedImplCopyWith<$Res> {
 88    factory _$$DhtState_DisconnectedImplCopyWith(
 89      _$DhtState_DisconnectedImpl value,
 90      $Res Function(_$DhtState_DisconnectedImpl) then,
 91    ) = __$$DhtState_DisconnectedImplCopyWithImpl<$Res>;
 92  }
 93  
 94  /// @nodoc
 95  class __$$DhtState_DisconnectedImplCopyWithImpl<$Res>
 96      extends _$DhtStateCopyWithImpl<$Res, _$DhtState_DisconnectedImpl>
 97      implements _$$DhtState_DisconnectedImplCopyWith<$Res> {
 98    __$$DhtState_DisconnectedImplCopyWithImpl(
 99      _$DhtState_DisconnectedImpl _value,
100      $Res Function(_$DhtState_DisconnectedImpl) _then,
101    ) : super(_value, _then);
102  
103    /// Create a copy of DhtState
104    /// with the given fields replaced by the non-null parameter values.
105  }
106  
107  /// @nodoc
108  
109  class _$DhtState_DisconnectedImpl extends DhtState_Disconnected {
110    const _$DhtState_DisconnectedImpl() : super._();
111  
112    @override
113    String toString() {
114      return 'DhtState.disconnected()';
115    }
116  
117    @override
118    bool operator ==(Object other) {
119      return identical(this, other) ||
120          (other.runtimeType == runtimeType &&
121              other is _$DhtState_DisconnectedImpl);
122    }
123  
124    @override
125    int get hashCode => runtimeType.hashCode;
126  
127    @override
128    @optionalTypeArgs
129    TResult when<TResult extends Object?>({
130      required TResult Function() disconnected,
131      required TResult Function() bootstrapping,
132      required TResult Function(BigInt peerCount) connected,
133      required TResult Function(String error) failed,
134    }) {
135      return disconnected();
136    }
137  
138    @override
139    @optionalTypeArgs
140    TResult? whenOrNull<TResult extends Object?>({
141      TResult? Function()? disconnected,
142      TResult? Function()? bootstrapping,
143      TResult? Function(BigInt peerCount)? connected,
144      TResult? Function(String error)? failed,
145    }) {
146      return disconnected?.call();
147    }
148  
149    @override
150    @optionalTypeArgs
151    TResult maybeWhen<TResult extends Object?>({
152      TResult Function()? disconnected,
153      TResult Function()? bootstrapping,
154      TResult Function(BigInt peerCount)? connected,
155      TResult Function(String error)? failed,
156      required TResult orElse(),
157    }) {
158      if (disconnected != null) {
159        return disconnected();
160      }
161      return orElse();
162    }
163  
164    @override
165    @optionalTypeArgs
166    TResult map<TResult extends Object?>({
167      required TResult Function(DhtState_Disconnected value) disconnected,
168      required TResult Function(DhtState_Bootstrapping value) bootstrapping,
169      required TResult Function(DhtState_Connected value) connected,
170      required TResult Function(DhtState_Failed value) failed,
171    }) {
172      return disconnected(this);
173    }
174  
175    @override
176    @optionalTypeArgs
177    TResult? mapOrNull<TResult extends Object?>({
178      TResult? Function(DhtState_Disconnected value)? disconnected,
179      TResult? Function(DhtState_Bootstrapping value)? bootstrapping,
180      TResult? Function(DhtState_Connected value)? connected,
181      TResult? Function(DhtState_Failed value)? failed,
182    }) {
183      return disconnected?.call(this);
184    }
185  
186    @override
187    @optionalTypeArgs
188    TResult maybeMap<TResult extends Object?>({
189      TResult Function(DhtState_Disconnected value)? disconnected,
190      TResult Function(DhtState_Bootstrapping value)? bootstrapping,
191      TResult Function(DhtState_Connected value)? connected,
192      TResult Function(DhtState_Failed value)? failed,
193      required TResult orElse(),
194    }) {
195      if (disconnected != null) {
196        return disconnected(this);
197      }
198      return orElse();
199    }
200  }
201  
202  abstract class DhtState_Disconnected extends DhtState {
203    const factory DhtState_Disconnected() = _$DhtState_DisconnectedImpl;
204    const DhtState_Disconnected._() : super._();
205  }
206  
207  /// @nodoc
208  abstract class _$$DhtState_BootstrappingImplCopyWith<$Res> {
209    factory _$$DhtState_BootstrappingImplCopyWith(
210      _$DhtState_BootstrappingImpl value,
211      $Res Function(_$DhtState_BootstrappingImpl) then,
212    ) = __$$DhtState_BootstrappingImplCopyWithImpl<$Res>;
213  }
214  
215  /// @nodoc
216  class __$$DhtState_BootstrappingImplCopyWithImpl<$Res>
217      extends _$DhtStateCopyWithImpl<$Res, _$DhtState_BootstrappingImpl>
218      implements _$$DhtState_BootstrappingImplCopyWith<$Res> {
219    __$$DhtState_BootstrappingImplCopyWithImpl(
220      _$DhtState_BootstrappingImpl _value,
221      $Res Function(_$DhtState_BootstrappingImpl) _then,
222    ) : super(_value, _then);
223  
224    /// Create a copy of DhtState
225    /// with the given fields replaced by the non-null parameter values.
226  }
227  
228  /// @nodoc
229  
230  class _$DhtState_BootstrappingImpl extends DhtState_Bootstrapping {
231    const _$DhtState_BootstrappingImpl() : super._();
232  
233    @override
234    String toString() {
235      return 'DhtState.bootstrapping()';
236    }
237  
238    @override
239    bool operator ==(Object other) {
240      return identical(this, other) ||
241          (other.runtimeType == runtimeType &&
242              other is _$DhtState_BootstrappingImpl);
243    }
244  
245    @override
246    int get hashCode => runtimeType.hashCode;
247  
248    @override
249    @optionalTypeArgs
250    TResult when<TResult extends Object?>({
251      required TResult Function() disconnected,
252      required TResult Function() bootstrapping,
253      required TResult Function(BigInt peerCount) connected,
254      required TResult Function(String error) failed,
255    }) {
256      return bootstrapping();
257    }
258  
259    @override
260    @optionalTypeArgs
261    TResult? whenOrNull<TResult extends Object?>({
262      TResult? Function()? disconnected,
263      TResult? Function()? bootstrapping,
264      TResult? Function(BigInt peerCount)? connected,
265      TResult? Function(String error)? failed,
266    }) {
267      return bootstrapping?.call();
268    }
269  
270    @override
271    @optionalTypeArgs
272    TResult maybeWhen<TResult extends Object?>({
273      TResult Function()? disconnected,
274      TResult Function()? bootstrapping,
275      TResult Function(BigInt peerCount)? connected,
276      TResult Function(String error)? failed,
277      required TResult orElse(),
278    }) {
279      if (bootstrapping != null) {
280        return bootstrapping();
281      }
282      return orElse();
283    }
284  
285    @override
286    @optionalTypeArgs
287    TResult map<TResult extends Object?>({
288      required TResult Function(DhtState_Disconnected value) disconnected,
289      required TResult Function(DhtState_Bootstrapping value) bootstrapping,
290      required TResult Function(DhtState_Connected value) connected,
291      required TResult Function(DhtState_Failed value) failed,
292    }) {
293      return bootstrapping(this);
294    }
295  
296    @override
297    @optionalTypeArgs
298    TResult? mapOrNull<TResult extends Object?>({
299      TResult? Function(DhtState_Disconnected value)? disconnected,
300      TResult? Function(DhtState_Bootstrapping value)? bootstrapping,
301      TResult? Function(DhtState_Connected value)? connected,
302      TResult? Function(DhtState_Failed value)? failed,
303    }) {
304      return bootstrapping?.call(this);
305    }
306  
307    @override
308    @optionalTypeArgs
309    TResult maybeMap<TResult extends Object?>({
310      TResult Function(DhtState_Disconnected value)? disconnected,
311      TResult Function(DhtState_Bootstrapping value)? bootstrapping,
312      TResult Function(DhtState_Connected value)? connected,
313      TResult Function(DhtState_Failed value)? failed,
314      required TResult orElse(),
315    }) {
316      if (bootstrapping != null) {
317        return bootstrapping(this);
318      }
319      return orElse();
320    }
321  }
322  
323  abstract class DhtState_Bootstrapping extends DhtState {
324    const factory DhtState_Bootstrapping() = _$DhtState_BootstrappingImpl;
325    const DhtState_Bootstrapping._() : super._();
326  }
327  
328  /// @nodoc
329  abstract class _$$DhtState_ConnectedImplCopyWith<$Res> {
330    factory _$$DhtState_ConnectedImplCopyWith(
331      _$DhtState_ConnectedImpl value,
332      $Res Function(_$DhtState_ConnectedImpl) then,
333    ) = __$$DhtState_ConnectedImplCopyWithImpl<$Res>;
334    @useResult
335    $Res call({BigInt peerCount});
336  }
337  
338  /// @nodoc
339  class __$$DhtState_ConnectedImplCopyWithImpl<$Res>
340      extends _$DhtStateCopyWithImpl<$Res, _$DhtState_ConnectedImpl>
341      implements _$$DhtState_ConnectedImplCopyWith<$Res> {
342    __$$DhtState_ConnectedImplCopyWithImpl(
343      _$DhtState_ConnectedImpl _value,
344      $Res Function(_$DhtState_ConnectedImpl) _then,
345    ) : super(_value, _then);
346  
347    /// Create a copy of DhtState
348    /// with the given fields replaced by the non-null parameter values.
349    @pragma('vm:prefer-inline')
350    @override
351    $Res call({Object? peerCount = null}) {
352      return _then(
353        _$DhtState_ConnectedImpl(
354          peerCount: null == peerCount
355              ? _value.peerCount
356              : peerCount // ignore: cast_nullable_to_non_nullable
357                    as BigInt,
358        ),
359      );
360    }
361  }
362  
363  /// @nodoc
364  
365  class _$DhtState_ConnectedImpl extends DhtState_Connected {
366    const _$DhtState_ConnectedImpl({required this.peerCount}) : super._();
367  
368    /// Number of known peers.
369    @override
370    final BigInt peerCount;
371  
372    @override
373    String toString() {
374      return 'DhtState.connected(peerCount: $peerCount)';
375    }
376  
377    @override
378    bool operator ==(Object other) {
379      return identical(this, other) ||
380          (other.runtimeType == runtimeType &&
381              other is _$DhtState_ConnectedImpl &&
382              (identical(other.peerCount, peerCount) ||
383                  other.peerCount == peerCount));
384    }
385  
386    @override
387    int get hashCode => Object.hash(runtimeType, peerCount);
388  
389    /// Create a copy of DhtState
390    /// with the given fields replaced by the non-null parameter values.
391    @JsonKey(includeFromJson: false, includeToJson: false)
392    @override
393    @pragma('vm:prefer-inline')
394    _$$DhtState_ConnectedImplCopyWith<_$DhtState_ConnectedImpl> get copyWith =>
395        __$$DhtState_ConnectedImplCopyWithImpl<_$DhtState_ConnectedImpl>(
396          this,
397          _$identity,
398        );
399  
400    @override
401    @optionalTypeArgs
402    TResult when<TResult extends Object?>({
403      required TResult Function() disconnected,
404      required TResult Function() bootstrapping,
405      required TResult Function(BigInt peerCount) connected,
406      required TResult Function(String error) failed,
407    }) {
408      return connected(peerCount);
409    }
410  
411    @override
412    @optionalTypeArgs
413    TResult? whenOrNull<TResult extends Object?>({
414      TResult? Function()? disconnected,
415      TResult? Function()? bootstrapping,
416      TResult? Function(BigInt peerCount)? connected,
417      TResult? Function(String error)? failed,
418    }) {
419      return connected?.call(peerCount);
420    }
421  
422    @override
423    @optionalTypeArgs
424    TResult maybeWhen<TResult extends Object?>({
425      TResult Function()? disconnected,
426      TResult Function()? bootstrapping,
427      TResult Function(BigInt peerCount)? connected,
428      TResult Function(String error)? failed,
429      required TResult orElse(),
430    }) {
431      if (connected != null) {
432        return connected(peerCount);
433      }
434      return orElse();
435    }
436  
437    @override
438    @optionalTypeArgs
439    TResult map<TResult extends Object?>({
440      required TResult Function(DhtState_Disconnected value) disconnected,
441      required TResult Function(DhtState_Bootstrapping value) bootstrapping,
442      required TResult Function(DhtState_Connected value) connected,
443      required TResult Function(DhtState_Failed value) failed,
444    }) {
445      return connected(this);
446    }
447  
448    @override
449    @optionalTypeArgs
450    TResult? mapOrNull<TResult extends Object?>({
451      TResult? Function(DhtState_Disconnected value)? disconnected,
452      TResult? Function(DhtState_Bootstrapping value)? bootstrapping,
453      TResult? Function(DhtState_Connected value)? connected,
454      TResult? Function(DhtState_Failed value)? failed,
455    }) {
456      return connected?.call(this);
457    }
458  
459    @override
460    @optionalTypeArgs
461    TResult maybeMap<TResult extends Object?>({
462      TResult Function(DhtState_Disconnected value)? disconnected,
463      TResult Function(DhtState_Bootstrapping value)? bootstrapping,
464      TResult Function(DhtState_Connected value)? connected,
465      TResult Function(DhtState_Failed value)? failed,
466      required TResult orElse(),
467    }) {
468      if (connected != null) {
469        return connected(this);
470      }
471      return orElse();
472    }
473  }
474  
475  abstract class DhtState_Connected extends DhtState {
476    const factory DhtState_Connected({required final BigInt peerCount}) =
477        _$DhtState_ConnectedImpl;
478    const DhtState_Connected._() : super._();
479  
480    /// Number of known peers.
481    BigInt get peerCount;
482  
483    /// Create a copy of DhtState
484    /// with the given fields replaced by the non-null parameter values.
485    @JsonKey(includeFromJson: false, includeToJson: false)
486    _$$DhtState_ConnectedImplCopyWith<_$DhtState_ConnectedImpl> get copyWith =>
487        throw _privateConstructorUsedError;
488  }
489  
490  /// @nodoc
491  abstract class _$$DhtState_FailedImplCopyWith<$Res> {
492    factory _$$DhtState_FailedImplCopyWith(
493      _$DhtState_FailedImpl value,
494      $Res Function(_$DhtState_FailedImpl) then,
495    ) = __$$DhtState_FailedImplCopyWithImpl<$Res>;
496    @useResult
497    $Res call({String error});
498  }
499  
500  /// @nodoc
501  class __$$DhtState_FailedImplCopyWithImpl<$Res>
502      extends _$DhtStateCopyWithImpl<$Res, _$DhtState_FailedImpl>
503      implements _$$DhtState_FailedImplCopyWith<$Res> {
504    __$$DhtState_FailedImplCopyWithImpl(
505      _$DhtState_FailedImpl _value,
506      $Res Function(_$DhtState_FailedImpl) _then,
507    ) : super(_value, _then);
508  
509    /// Create a copy of DhtState
510    /// with the given fields replaced by the non-null parameter values.
511    @pragma('vm:prefer-inline')
512    @override
513    $Res call({Object? error = null}) {
514      return _then(
515        _$DhtState_FailedImpl(
516          error: null == error
517              ? _value.error
518              : error // ignore: cast_nullable_to_non_nullable
519                    as String,
520        ),
521      );
522    }
523  }
524  
525  /// @nodoc
526  
527  class _$DhtState_FailedImpl extends DhtState_Failed {
528    const _$DhtState_FailedImpl({required this.error}) : super._();
529  
530    /// Error description.
531    @override
532    final String error;
533  
534    @override
535    String toString() {
536      return 'DhtState.failed(error: $error)';
537    }
538  
539    @override
540    bool operator ==(Object other) {
541      return identical(this, other) ||
542          (other.runtimeType == runtimeType &&
543              other is _$DhtState_FailedImpl &&
544              (identical(other.error, error) || other.error == error));
545    }
546  
547    @override
548    int get hashCode => Object.hash(runtimeType, error);
549  
550    /// Create a copy of DhtState
551    /// with the given fields replaced by the non-null parameter values.
552    @JsonKey(includeFromJson: false, includeToJson: false)
553    @override
554    @pragma('vm:prefer-inline')
555    _$$DhtState_FailedImplCopyWith<_$DhtState_FailedImpl> get copyWith =>
556        __$$DhtState_FailedImplCopyWithImpl<_$DhtState_FailedImpl>(
557          this,
558          _$identity,
559        );
560  
561    @override
562    @optionalTypeArgs
563    TResult when<TResult extends Object?>({
564      required TResult Function() disconnected,
565      required TResult Function() bootstrapping,
566      required TResult Function(BigInt peerCount) connected,
567      required TResult Function(String error) failed,
568    }) {
569      return failed(error);
570    }
571  
572    @override
573    @optionalTypeArgs
574    TResult? whenOrNull<TResult extends Object?>({
575      TResult? Function()? disconnected,
576      TResult? Function()? bootstrapping,
577      TResult? Function(BigInt peerCount)? connected,
578      TResult? Function(String error)? failed,
579    }) {
580      return failed?.call(error);
581    }
582  
583    @override
584    @optionalTypeArgs
585    TResult maybeWhen<TResult extends Object?>({
586      TResult Function()? disconnected,
587      TResult Function()? bootstrapping,
588      TResult Function(BigInt peerCount)? connected,
589      TResult Function(String error)? failed,
590      required TResult orElse(),
591    }) {
592      if (failed != null) {
593        return failed(error);
594      }
595      return orElse();
596    }
597  
598    @override
599    @optionalTypeArgs
600    TResult map<TResult extends Object?>({
601      required TResult Function(DhtState_Disconnected value) disconnected,
602      required TResult Function(DhtState_Bootstrapping value) bootstrapping,
603      required TResult Function(DhtState_Connected value) connected,
604      required TResult Function(DhtState_Failed value) failed,
605    }) {
606      return failed(this);
607    }
608  
609    @override
610    @optionalTypeArgs
611    TResult? mapOrNull<TResult extends Object?>({
612      TResult? Function(DhtState_Disconnected value)? disconnected,
613      TResult? Function(DhtState_Bootstrapping value)? bootstrapping,
614      TResult? Function(DhtState_Connected value)? connected,
615      TResult? Function(DhtState_Failed value)? failed,
616    }) {
617      return failed?.call(this);
618    }
619  
620    @override
621    @optionalTypeArgs
622    TResult maybeMap<TResult extends Object?>({
623      TResult Function(DhtState_Disconnected value)? disconnected,
624      TResult Function(DhtState_Bootstrapping value)? bootstrapping,
625      TResult Function(DhtState_Connected value)? connected,
626      TResult Function(DhtState_Failed value)? failed,
627      required TResult orElse(),
628    }) {
629      if (failed != null) {
630        return failed(this);
631      }
632      return orElse();
633    }
634  }
635  
636  abstract class DhtState_Failed extends DhtState {
637    const factory DhtState_Failed({required final String error}) =
638        _$DhtState_FailedImpl;
639    const DhtState_Failed._() : super._();
640  
641    /// Error description.
642    String get error;
643  
644    /// Create a copy of DhtState
645    /// with the given fields replaced by the non-null parameter values.
646    @JsonKey(includeFromJson: false, includeToJson: false)
647    _$$DhtState_FailedImplCopyWith<_$DhtState_FailedImpl> get copyWith =>
648        throw _privateConstructorUsedError;
649  }