3 public class PositiveTimestamp {
5 public internal(set) var cOpaqueStruct: LDKPositiveTimestamp?;
9 public init(pointer: LDKPositiveTimestamp){
10 self.cOpaqueStruct = pointer
13 /* STRUCT_METHODS_START */
15 public func eq(a: PositiveTimestamp, b: PositiveTimestamp) -> Bool {
17 return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKPositiveTimestamp>) in
18 withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKPositiveTimestamp>) in
19 PositiveTimestamp_eq(aPointer, bPointer)
24 public func clone(orig: PositiveTimestamp) -> PositiveTimestamp {
26 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKPositiveTimestamp>) in
27 PositiveTimestamp(pointer: PositiveTimestamp_clone(origPointer))
31 public func from_unix_timestamp(unix_seconds: UInt64) -> Result_PositiveTimestampCreationErrorZ {
33 return Result_PositiveTimestampCreationErrorZ(pointer: PositiveTimestamp_from_unix_timestamp(unix_seconds));
36 public func from_system_time(time: UInt64) -> Result_PositiveTimestampCreationErrorZ {
38 return Result_PositiveTimestampCreationErrorZ(pointer: PositiveTimestamp_from_system_time(time));
41 public func as_unix_timestamp() -> UInt64 {
43 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKPositiveTimestamp>) in
44 PositiveTimestamp_as_unix_timestamp(this_argPointer)
48 public func as_time() -> UInt64 {
50 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKPositiveTimestamp>) in
51 PositiveTimestamp_as_time(this_argPointer)
57 if self.cOpaqueStruct?.is_owned == false {
61 PositiveTimestamp_free(self.cOpaqueStruct!)
67 /* STRUCT_METHODS_END */