3 public class ExpiryTime {
5 public internal(set) var cOpaqueStruct: LDKExpiryTime?;
9 public init(pointer: LDKExpiryTime){
10 self.cOpaqueStruct = pointer
13 /* STRUCT_METHODS_START */
15 public func eq(a: ExpiryTime, b: ExpiryTime) -> Bool {
17 return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKExpiryTime>) in
18 withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKExpiryTime>) in
19 ExpiryTime_eq(aPointer, bPointer)
24 public func clone(orig: ExpiryTime) -> ExpiryTime {
26 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKExpiryTime>) in
27 ExpiryTime(pointer: ExpiryTime_clone(origPointer))
31 public func from_seconds(seconds: UInt64) -> Result_ExpiryTimeCreationErrorZ {
33 return Result_ExpiryTimeCreationErrorZ(pointer: ExpiryTime_from_seconds(seconds));
36 public func from_duration(duration: UInt64) -> Result_ExpiryTimeCreationErrorZ {
38 return Result_ExpiryTimeCreationErrorZ(pointer: ExpiryTime_from_duration(duration));
41 public func as_seconds() -> UInt64 {
43 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKExpiryTime>) in
44 ExpiryTime_as_seconds(this_argPointer)
48 public func as_duration() -> UInt64 {
50 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKExpiryTime>) in
51 ExpiryTime_as_duration(this_argPointer)
57 if self.cOpaqueStruct?.is_owned == false {
61 ExpiryTime_free(self.cOpaqueStruct!)
67 /* STRUCT_METHODS_END */