File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -147,17 +147,26 @@ impl ControlMessage<'a> {
147
147
cmsg_type : c_int ,
148
148
data : & 'a [u8 ],
149
149
) -> ControlMessage <'a >;
150
+ }
150
151
152
+ impl ControlMessage <'_ > {
151
153
// Opaque platform-specific integers; same as `struct cmsghdr` fields.
152
154
fn cmsg_level (& self ) -> c_int ;
153
155
fn cmsg_type (& self ) -> c_int ;
154
156
155
157
// The type-specific data of this control message.
156
158
fn data (& self ) -> & [u8 ];
157
159
160
+ // How big the encoded cmsg is; same as `CMSG_SPACE()`.
161
+ fn cmsg_space (& self ) -> usize ;
162
+
158
163
// Whether this control message is truncated, such as by being received
159
164
// into a too-short buffer.
160
165
fn truncated (& self ) -> bool ;
166
+
167
+ // Encodes the cmsg according to local OS conventions. `dst` must be
168
+ // `cmsg_space()` bytes long.
169
+ fn copy_to_slice <'a >(& self , dst : & 'a mut [MaybeUninit <u8 >]) -> & 'a [u8 ];
161
170
}
162
171
```
163
172
You can’t perform that action at this time.
0 commit comments