Skip to content

Commit

Permalink
chore(docs): add deny missing docs to package streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Feb 20, 2023
1 parent 22bbffa commit 713449f
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions crates/rattler_package_streaming/src/fs.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Functions to extracting or stream a Conda package from a file on disk.

use crate::{ArchiveType, ExtractError};
use std::fs::File;
use std::path::Path;
Expand Down
5 changes: 4 additions & 1 deletion crates/rattler_package_streaming/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//! This crate provides the ability to extract a package archive or specific parts of it.
#![deny(missing_docs)]

//! This crate provides the ability to extract a Conda package archive or specific parts of it.

use std::path::Path;

Expand All @@ -14,6 +16,7 @@ pub mod tokio;

/// An error that can occur when extracting a package archive.
#[derive(thiserror::Error, Debug)]
#[allow(missing_docs)]
pub enum ExtractError {
#[error("an io error occurred")]
IoError(#[from] std::io::Error),
Expand Down
3 changes: 3 additions & 0 deletions crates/rattler_package_streaming/src/read.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Functions that enable extracting or streaming a Conda package for objects that implement the
//! [`std::io::Read`] trait.

use super::ExtractError;
use std::ffi::OsStr;
use std::{io::Read, path::Path};
Expand Down
2 changes: 2 additions & 0 deletions crates/rattler_package_streaming/src/reqwest/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Functionality to stream and extract packages directly from a [`reqwest::Url`].

#[cfg(feature = "tokio")]
pub mod tokio;

Expand Down
3 changes: 3 additions & 0 deletions crates/rattler_package_streaming/src/reqwest/tokio.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Functionality to stream and extract packages directly from a [`reqwest::Url`] within a [`tokio`]
//! async context.

use crate::{ArchiveType, ExtractError};
use futures_util::stream::TryStreamExt;
use reqwest::IntoUrl;
Expand Down
5 changes: 4 additions & 1 deletion crates/rattler_package_streaming/src/seek.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Functionality to stream parts of a `.conda` archive for objects that implement both
//! [`std::io::Read`] and [`std::io::Seek`] like a [`std::fs::File`] or a [`std::io::Cursor<T>`].

use crate::read::stream_tar_zst;
use crate::ExtractError;
use std::io::{Read, Seek, SeekFrom};
Expand All @@ -23,7 +26,7 @@ fn stream_conda_zip_entry<'a>(
let mut reader = archive.into_inner();
reader.seek(SeekFrom::Start(offset))?;

// Open the info entry for reading
// Given the bytes in the zip archive of the file, decode it as a zst compressed tar file.
stream_tar_zst(reader.take(size))
}

Expand Down
3 changes: 3 additions & 0 deletions crates/rattler_package_streaming/src/tokio/async_read.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Functions that enable extracting or streaming a Conda package for objects that implement the
//! [`tokio::io::AsyncRead`] trait.

use crate::ExtractError;
use std::path::Path;
use tokio::io::AsyncRead;
Expand Down
2 changes: 2 additions & 0 deletions crates/rattler_package_streaming/src/tokio/fs.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Functions to extracting or stream a Conda package from a file on disk.

use crate::{ArchiveType, ExtractError};
use std::path::Path;

Expand Down
2 changes: 2 additions & 0 deletions crates/rattler_package_streaming/src/tokio/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
//! Functionality to stream and extract packages in an [`tokio`] async context.

pub mod async_read;
pub mod fs;

0 comments on commit 713449f

Please sign in to comment.