1
1
//! Creating and manipulating links within an HDF5 group
2
+ #[ cfg( feature = "1.12.0" ) ]
3
+ use std:: fmt;
2
4
use std:: mem;
3
5
4
6
pub use self :: H5L_type_t :: * ;
@@ -64,14 +66,14 @@ impl H5L_info1_t__u {
64
66
}
65
67
66
68
#[ repr( C ) ]
67
- #[ derive( Debug , Copy , Clone ) ]
69
+ #[ derive( Copy , Clone ) ]
68
70
#[ cfg( feature = "1.12.0" ) ]
69
71
pub struct H5L_info2_t {
70
72
pub type_ : H5L_type_t ,
71
73
pub corder_valid : hbool_t ,
72
74
pub corder : int64_t ,
73
75
pub cset : H5T_cset_t ,
74
- pub u : H5L_info1_t__u ,
76
+ pub u : H5L_info2_t__u ,
75
77
}
76
78
77
79
#[ cfg( feature = "1.12.0" ) ]
@@ -81,6 +83,29 @@ impl Default for H5L_info2_t {
81
83
}
82
84
}
83
85
86
+ #[ cfg( feature = "1.12.0" ) ]
87
+ impl fmt:: Debug for H5L_info2_t {
88
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
89
+ let mut debug_struct = f. debug_struct ( "H5L_info2_t" ) ;
90
+ debug_struct
91
+ . field ( "type_" , & self . type_ )
92
+ . field ( "corder_valid" , & self . corder_valid )
93
+ . field ( "corder" , & self . corder )
94
+ . field ( "cset" , & self . cset ) ;
95
+
96
+ match self . type_ {
97
+ H5L_TYPE_HARD => {
98
+ debug_struct. field ( "token" , unsafe { & self . u . token } ) ;
99
+ }
100
+ H5L_TYPE_SOFT | H5L_TYPE_EXTERNAL | H5L_TYPE_MAX => {
101
+ debug_struct. field ( "val_size" , unsafe { & self . u . val_size } ) ;
102
+ }
103
+ H5L_TYPE_ERROR => { }
104
+ }
105
+ debug_struct. finish ( )
106
+ }
107
+ }
108
+
84
109
#[ repr( C ) ]
85
110
#[ derive( Copy , Clone ) ]
86
111
#[ cfg( feature = "1.12.0" ) ]
@@ -96,6 +121,16 @@ impl Default for H5L_info2_t__u {
96
121
}
97
122
}
98
123
124
+ #[ cfg( feature = "1.12.0" ) ]
125
+ impl H5L_info2_t__u {
126
+ pub unsafe fn token ( & mut self ) -> * mut H5O_token_t {
127
+ & mut self . token as * mut H5O_token_t
128
+ }
129
+ pub unsafe fn val_size ( & mut self ) -> * mut size_t {
130
+ & mut self . val_size as * mut size_t
131
+ }
132
+ }
133
+
99
134
pub type H5L_create_func_t = Option <
100
135
extern "C" fn (
101
136
link_name : * const c_char ,
0 commit comments