Skip to content

Commit

Permalink
Publically doc and export
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Jan 14, 2025
1 parent 8acb070 commit cd05188
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions parquet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ pub mod data_type;
pub use self::encodings::{decoding, encoding};

experimental!(#[macro_use] mod util);

pub use util::utf8;

#[cfg(feature = "arrow")]
pub mod arrow;
pub mod column;
Expand Down
2 changes: 1 addition & 1 deletion parquet/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub(crate) mod interner;

#[cfg(any(test, feature = "test_common"))]
pub(crate) mod test_common;
pub(crate) mod utf8;
pub mod utf8;

#[cfg(any(test, feature = "test_common"))]
pub use self::test_common::page_util::{
Expand Down
9 changes: 9 additions & 0 deletions parquet/src/util/utf8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ use crate::errors::{Result, ParquetError};
///
/// Returns `Err::General` with a message compatible with [`std::str::from_utf8`] on failure.
///
/// # Example
/// ```
/// use parquet::utf8::check_valid_utf8;
/// assert!(check_valid_utf8(b"hello").is_ok());
/// assert!(check_valid_utf8(b"hello \xF0\x9F\x98\x8E").is_ok());
/// // invalid UTF-8
/// assert!(check_valid_utf8(b"hello \xF0\x9F\x98").is_err());
/// ```
///
/// [`simdutf8`]: https://crates.io/crates/simdutf8
#[inline(always)]
pub fn check_valid_utf8(val: &[u8]) -> Result<()> {
Expand Down

0 comments on commit cd05188

Please sign in to comment.