Skip to content

Commit 1980f11

Browse files
committed
Clean up block_dev::DeviceInfo
You can't use it if the fields aren't pub.
1 parent 058ddd2 commit 1980f11

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/block_dev.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
// Types
3636
// ============================================================================
3737

38-
/// The kinds of block device we support.
38+
/// The types of block device we support.
3939
#[repr(C)]
4040
#[derive(Clone, PartialEq, Eq, Debug)]
41-
pub enum Kind {
41+
pub enum DeviceType {
4242
/// An *SD* Card
4343
SecureDigitalCard,
4444
/// A Hard Drive
@@ -53,20 +53,23 @@ pub enum Kind {
5353
#[repr(C)]
5454
#[derive(Clone, PartialEq, Eq, Debug)]
5555
pub struct DeviceInfo {
56+
/// Some human-readable name for this serial device (e.g. `SdCard0` or
57+
/// `CF1`)
58+
pub name: crate::ApiString<'static>,
5659
/// The kind of block device this is.
57-
kind: Kind,
60+
pub device_type: DeviceType,
5861
/// The size of an addressable block, in bytes.
59-
block_size: u32,
62+
pub block_size: u32,
6063
/// The total number of addressable blocks.
61-
num_blocks: u64,
64+
pub num_blocks: u64,
6265
/// Can this device be ejected?
63-
ejectable: bool,
66+
pub ejectable: bool,
6467
/// Can this device be removed?
65-
removable: bool,
68+
pub removable: bool,
6669
/// Does this have media in it right now?
67-
media_present: bool,
70+
pub media_present: bool,
6871
/// Is this media read-only?
69-
read_only: bool,
72+
pub read_only: bool,
7073
}
7174

7275
// ============================================================================

0 commit comments

Comments
 (0)