Skip to content

Commit 0865be5

Browse files
daymDanny Milosavljevic
authored and
Danny Milosavljevic
committed
111 ondisk: Make more implementation details private.
1 parent d67bc07 commit 0865be5

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "amd-apcb"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
authors = ["Oxide Computer"]
55
edition = "2018"
66

src/group.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ use crate::ondisk::ENTRY_ALIGNMENT;
1010
use crate::ondisk::ENTRY_HEADER;
1111
use crate::ondisk::GROUP_HEADER;
1212
use crate::ondisk::TOKEN_ENTRY;
13-
pub use crate::ondisk::{
13+
use crate::ondisk::{
1414
take_body_from_collection, take_body_from_collection_mut,
1515
take_header_from_collection, take_header_from_collection_mut,
16+
};
17+
pub use crate::ondisk::{
1618
BoardInstances, ContextFormat, ContextType, EntryId, PriorityLevels,
1719
};
1820
use core::convert::TryInto;

src/ondisk.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ pub trait HeaderWithTail {
8989
/// Given *BUF (a collection of multiple items), retrieves the first of the
9090
/// items and returns it after advancing *BUF to the next item. If the item
9191
/// cannot be parsed, returns None and does not advance.
92-
pub fn take_header_from_collection_mut<'a, T: Sized + FromBytes + AsBytes>(
92+
pub(crate) fn take_header_from_collection_mut<
93+
'a,
94+
T: Sized + FromBytes + AsBytes,
95+
>(
9396
buf: &mut &'a mut [u8],
9497
) -> Option<&'a mut T> {
9598
let xbuf = take(&mut *buf);
@@ -107,7 +110,7 @@ pub fn take_header_from_collection_mut<'a, T: Sized + FromBytes + AsBytes>(
107110
/// *BUF had been aligned to ALIGNMENT before the call, it also ensures that
108111
/// *BUF is aligned to ALIGNMENT after the call. If the item cannot be parsed,
109112
/// returns None and does not advance.
110-
pub fn take_body_from_collection_mut<'a>(
113+
pub(crate) fn take_body_from_collection_mut<'a>(
111114
buf: &mut &'a mut [u8],
112115
size: usize,
113116
alignment: usize,
@@ -131,7 +134,7 @@ pub fn take_body_from_collection_mut<'a>(
131134
/// Given *BUF (a collection of multiple items), retrieves the first of the
132135
/// items and returns it after advancing *BUF to the next item. If the item
133136
/// cannot be parsed, returns None and does not advance.
134-
pub fn take_header_from_collection<'a, T: Sized + FromBytes>(
137+
pub(crate) fn take_header_from_collection<'a, T: Sized + FromBytes>(
135138
buf: &mut &'a [u8],
136139
) -> Option<&'a T> {
137140
let xbuf = take(&mut *buf);
@@ -149,7 +152,7 @@ pub fn take_header_from_collection<'a, T: Sized + FromBytes>(
149152
/// *BUF had been aligned to ALIGNMENT before the call, it also ensures that
150153
/// *BUF is aligned to ALIGNMENT after the call. If the item cannot be parsed,
151154
/// returns None and does not advance.
152-
pub fn take_body_from_collection<'a>(
155+
pub(crate) fn take_body_from_collection<'a>(
153156
buf: &mut &'a [u8],
154157
size: usize,
155158
alignment: usize,

0 commit comments

Comments
 (0)