Skip to content

Commit bfd0526

Browse files
committed
docs: add warnings to ABI-incompatible enums
1 parent 37a46c9 commit bfd0526

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,15 @@ virtio_bitflags! {
163163
}
164164

165165
/// Virtio Device IDs
166+
///
167+
/// <div class="warning">
168+
///
169+
/// This enum is not ABI-compatible with it's corresponding field.
170+
/// Use [`Id::from`] for converting from an integer.
171+
///
172+
/// </div>
173+
///
174+
/// [`Id::from`]: Id#impl-From<u8>-for-Id
166175
#[derive(IntoPrimitive, FromPrimitive, PartialEq, Eq, Clone, Copy, Debug)]
167176
#[non_exhaustive]
168177
#[repr(u8)]

src/net.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ virtio_bitflags! {
7878
}
7979

8080
/// Network Device Header GSO Type
81+
///
82+
/// <div class="warning">
83+
///
84+
/// This enum is not ABI-compatible with it's corresponding field.
85+
/// Use [`HdrGso::from`] for converting from an integer.
86+
///
87+
/// </div>
88+
///
89+
/// [`HdrGso::from`]: HdrGso#impl-From<u8>-for-HdrGso
8190
#[doc(alias = "VIRTIO_NET_HDR_GSO")]
8291
#[derive(IntoPrimitive, FromPrimitive, PartialEq, Eq, Clone, Copy, Debug)]
8392
#[non_exhaustive]
@@ -186,6 +195,15 @@ endian_bitflags! {
186195
}
187196

188197
/// Hash Report
198+
///
199+
/// <div class="warning">
200+
///
201+
/// This enum is not ABI-compatible with it's corresponding field.
202+
/// Use [`HashReport::from`] for converting from an integer.
203+
///
204+
/// </div>
205+
///
206+
/// [`HashReport::from`]: HashReport#impl-From<u16>-for-HashReport
189207
#[doc(alias = "VIRTIO_NET_HASH_REPORT")]
190208
#[derive(IntoPrimitive, FromPrimitive, PartialEq, Eq, Clone, Copy, Debug)]
191209
#[non_exhaustive]

src/pci.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,15 @@ impl CapData {
270270
}
271271

272272
/// PCI Capability Configuration Type
273+
///
274+
/// <div class="warning">
275+
///
276+
/// This enum is not ABI-compatible with it's corresponding field.
277+
/// Use [`CapCfgType::from`] for converting from an integer.
278+
///
279+
/// </div>
280+
///
281+
/// [`CapCfgType::from`]: CapCfgType#impl-From<u8>-for-CapCfgType
273282
#[doc(alias = "VIRTIO_PCI_CAP")]
274283
#[derive(IntoPrimitive, FromPrimitive, PartialEq, Eq, Clone, Copy, Debug)]
275284
#[non_exhaustive]

0 commit comments

Comments
 (0)