Skip to content

Commit 3ec14fd

Browse files
committed
Create option to not dangle an object when adding an anchor upon init.
1 parent 5debb3e commit 3ec14fd

File tree

464 files changed

+9224
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

464 files changed

+9224
-0
lines changed

out/enums/complex/APIError.swift

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@
1515
public class APIError: NativeTypeWrapper {
1616

1717

18+
/// Set to false to suppress an individual type's deinit log statements.
19+
/// Only applicable when log threshold is set to `.Debug`.
1820
public static var enableDeinitLogging = true
21+
22+
/// Set to true to suspend the freeing of this type's associated Rust memory.
23+
/// Should only ever be used for debugging purposes, and will likely be
24+
/// deprecated soon.
1925
public static var suspendFreedom = false
26+
2027
private static var instanceCounter: UInt = 0
2128
internal let instanceNumber: UInt
2229

@@ -39,6 +46,16 @@
3946
self.dangling = true
4047
try! self.addAnchor(anchor: anchor)
4148
}
49+
50+
internal init(cType: LDKAPIError, instantiationContext: String, anchor: NativeTypeWrapper, dangle: Bool = false) {
51+
Self.instanceCounter += 1
52+
self.instanceNumber = Self.instanceCounter
53+
self.cType = cType
54+
55+
super.init(conflictAvoidingVariableName: 0, instantiationContext: instantiationContext)
56+
self.dangling = dangle
57+
try! self.addAnchor(anchor: anchor)
58+
}
4259

4360

4461
public enum APIErrorType {
@@ -446,8 +463,15 @@
446463

447464

448465

466+
/// Set to false to suppress an individual type's deinit log statements.
467+
/// Only applicable when log threshold is set to `.Debug`.
449468
public static var enableDeinitLogging = true
469+
470+
/// Set to true to suspend the freeing of this type's associated Rust memory.
471+
/// Should only ever be used for debugging purposes, and will likely be
472+
/// deprecated soon.
450473
public static var suspendFreedom = false
474+
451475
private static var instanceCounter: UInt = 0
452476
internal let instanceNumber: UInt
453477

@@ -470,6 +494,16 @@
470494
self.dangling = true
471495
try! self.addAnchor(anchor: anchor)
472496
}
497+
498+
internal init(cType: LDKAPIError_LDKAPIMisuseError_Body, instantiationContext: String, anchor: NativeTypeWrapper, dangle: Bool = false) {
499+
Self.instanceCounter += 1
500+
self.instanceNumber = Self.instanceCounter
501+
self.cType = cType
502+
503+
super.init(conflictAvoidingVariableName: 0, instantiationContext: instantiationContext)
504+
self.dangling = dangle
505+
try! self.addAnchor(anchor: anchor)
506+
}
473507

474508

475509

@@ -506,8 +540,15 @@
506540

507541

508542

543+
/// Set to false to suppress an individual type's deinit log statements.
544+
/// Only applicable when log threshold is set to `.Debug`.
509545
public static var enableDeinitLogging = true
546+
547+
/// Set to true to suspend the freeing of this type's associated Rust memory.
548+
/// Should only ever be used for debugging purposes, and will likely be
549+
/// deprecated soon.
510550
public static var suspendFreedom = false
551+
511552
private static var instanceCounter: UInt = 0
512553
internal let instanceNumber: UInt
513554

@@ -530,6 +571,16 @@
530571
self.dangling = true
531572
try! self.addAnchor(anchor: anchor)
532573
}
574+
575+
internal init(cType: LDKAPIError_LDKFeeRateTooHigh_Body, instantiationContext: String, anchor: NativeTypeWrapper, dangle: Bool = false) {
576+
Self.instanceCounter += 1
577+
self.instanceNumber = Self.instanceCounter
578+
self.cType = cType
579+
580+
super.init(conflictAvoidingVariableName: 0, instantiationContext: instantiationContext)
581+
self.dangling = dangle
582+
try! self.addAnchor(anchor: anchor)
583+
}
533584

534585

535586

@@ -574,8 +625,15 @@
574625

575626

576627

628+
/// Set to false to suppress an individual type's deinit log statements.
629+
/// Only applicable when log threshold is set to `.Debug`.
577630
public static var enableDeinitLogging = true
631+
632+
/// Set to true to suspend the freeing of this type's associated Rust memory.
633+
/// Should only ever be used for debugging purposes, and will likely be
634+
/// deprecated soon.
578635
public static var suspendFreedom = false
636+
579637
private static var instanceCounter: UInt = 0
580638
internal let instanceNumber: UInt
581639

@@ -598,6 +656,16 @@
598656
self.dangling = true
599657
try! self.addAnchor(anchor: anchor)
600658
}
659+
660+
internal init(cType: LDKAPIError_LDKInvalidRoute_Body, instantiationContext: String, anchor: NativeTypeWrapper, dangle: Bool = false) {
661+
Self.instanceCounter += 1
662+
self.instanceNumber = Self.instanceCounter
663+
self.cType = cType
664+
665+
super.init(conflictAvoidingVariableName: 0, instantiationContext: instantiationContext)
666+
self.dangling = dangle
667+
try! self.addAnchor(anchor: anchor)
668+
}
601669

602670

603671

@@ -634,8 +702,15 @@
634702

635703

636704

705+
/// Set to false to suppress an individual type's deinit log statements.
706+
/// Only applicable when log threshold is set to `.Debug`.
637707
public static var enableDeinitLogging = true
708+
709+
/// Set to true to suspend the freeing of this type's associated Rust memory.
710+
/// Should only ever be used for debugging purposes, and will likely be
711+
/// deprecated soon.
638712
public static var suspendFreedom = false
713+
639714
private static var instanceCounter: UInt = 0
640715
internal let instanceNumber: UInt
641716

@@ -658,6 +733,16 @@
658733
self.dangling = true
659734
try! self.addAnchor(anchor: anchor)
660735
}
736+
737+
internal init(cType: LDKAPIError_LDKChannelUnavailable_Body, instantiationContext: String, anchor: NativeTypeWrapper, dangle: Bool = false) {
738+
Self.instanceCounter += 1
739+
self.instanceNumber = Self.instanceCounter
740+
self.cType = cType
741+
742+
super.init(conflictAvoidingVariableName: 0, instantiationContext: instantiationContext)
743+
self.dangling = dangle
744+
try! self.addAnchor(anchor: anchor)
745+
}
661746

662747

663748

@@ -694,8 +779,15 @@
694779

695780

696781

782+
/// Set to false to suppress an individual type's deinit log statements.
783+
/// Only applicable when log threshold is set to `.Debug`.
697784
public static var enableDeinitLogging = true
785+
786+
/// Set to true to suspend the freeing of this type's associated Rust memory.
787+
/// Should only ever be used for debugging purposes, and will likely be
788+
/// deprecated soon.
698789
public static var suspendFreedom = false
790+
699791
private static var instanceCounter: UInt = 0
700792
internal let instanceNumber: UInt
701793

@@ -718,6 +810,16 @@
718810
self.dangling = true
719811
try! self.addAnchor(anchor: anchor)
720812
}
813+
814+
internal init(cType: LDKAPIError_LDKIncompatibleShutdownScript_Body, instantiationContext: String, anchor: NativeTypeWrapper, dangle: Bool = false) {
815+
Self.instanceCounter += 1
816+
self.instanceNumber = Self.instanceCounter
817+
self.cType = cType
818+
819+
super.init(conflictAvoidingVariableName: 0, instantiationContext: instantiationContext)
820+
self.dangling = dangle
821+
try! self.addAnchor(anchor: anchor)
822+
}
721823

722824

723825

0 commit comments

Comments
 (0)