Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / Description.swift
1 import LDKCHeaders
2
3 public class Description {
4
5     public internal(set) var cOpaqueStruct: LDKDescription?;
6
7         
8
9     public init(pointer: LDKDescription){
10                 self.cOpaqueStruct = pointer
11         }
12
13     /* STRUCT_METHODS_START */
14
15     public func eq(a: Description, b: Description) -> Bool {
16         
17         return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKDescription>) in
18 withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKDescription>) in
19 Description_eq(aPointer, bPointer)
20 }
21 };
22     }
23
24     public func clone(orig: Description) -> Description {
25         
26         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKDescription>) in
27 Description(pointer: Description_clone(origPointer))
28 };
29     }
30
31     public func new(description: String) -> Result_DescriptionCreationErrorZ {
32         
33         return Result_DescriptionCreationErrorZ(pointer: Description_new(Bindings.new_LDKStr(string: description)));
34     }
35
36     public func into_inner() -> String {
37         
38         return Bindings.LDKStr_to_string(nativeType: Description_into_inner(self.cOpaqueStruct!));
39     }
40
41                                 
42         deinit {
43                                         if self.cOpaqueStruct?.is_owned == false {
44
45                                         
46                                         
47                 Description_free(self.cOpaqueStruct!)
48                                         
49 }
50                                 
51         }
52                         
53     /* STRUCT_METHODS_END */
54
55 }