Skip to content

feat: Template out rebuild#25

Merged
mhambre merged 2 commits into
masterfrom
feat/template-rebuild
Jun 4, 2026
Merged

feat: Template out rebuild#25
mhambre merged 2 commits into
masterfrom
feat/template-rebuild

Conversation

@mhambre

@mhambre mhambre commented Jun 4, 2026

Copy link
Copy Markdown
Owner

No description provided.

@mhambre mhambre marked this pull request as ready for review June 4, 2026 04:17
Copilot AI review requested due to automatic review settings June 4, 2026 04:17
@mhambre mhambre merged commit c7ccc4f into master Jun 4, 2026
12 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR turns the crate back into a compilable library by introducing the core public API surface (traits, builder, registry, instance/viewer/types) and re-enabling CI workflows to run formatting, clippy, checks, and tests.

Changes:

  • Added SparseIO instance + Builder, plus foundational Reader/Writer/Metadata traits and supporting types.
  • Introduced a ReaderRegistry with unit tests and testing stubs for Reader/Writer/Metadata.
  • Re-enabled GitHub Actions unit/quality workflows and updated architecture docs to match renamed APIs.

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/lib.rs Defines crate module structure and exports; now serves as the main public surface.
src/instance.rs Adds SparseIO coordinator and public entrypoints (builder, open).
src/builder.rs Implements builder pattern for constructing SparseIO with validation + tests.
src/traits.rs Introduces the core backend traits (Reader, Writer, Metadata).
src/types.rs Adds ByteStream type used by Viewer.
src/viewer.rs Adds Viewer read interface (currently stubbed).
src/registry.rs Adds ReaderRegistry abstraction + unit tests.
src/utils/** Adds test-only stubs for backends used in unit tests.
docs/architecture/*.md Updates docs to match Builder and read_at/bytestream naming.
.github/workflows/*.yml Enables CI steps for tests, clippy, fmt, and checks.
Cargo.toml Adds dependencies used by the new API (bytes, parking_lot).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib.rs
Comment on lines +1 to +12
mod builder;
mod globals;
mod instance;
mod registry;
mod traits;
mod types;
mod utils;
mod viewer;

pub use instance::SparseIO;
pub use registry::ReaderRegistry;
pub use traits::{Metadata, Reader, Writer};
Comment thread src/instance.rs
Comment on lines +26 to +35
/// Create a builder for configuring a SparseIO instance.
pub fn builder() -> crate::builder::Builder {
crate::builder::Builder::new()
}

/// Open a canonical SparseIO path and return a viewer over the object.
pub fn open(&self, path: impl AsRef<str>) -> io::Result<Viewer> {
let _ = path;
todo!("resolve reader and create viewer")
}
Comment thread src/viewer.rs
Comment on lines +16 to +31
impl Viewer {
/// Alias for offset-based reads.
pub fn read_at(&self, _offset: usize, _length: usize) -> io::Result<Bytes> {
todo!("read bytes at offset from upstream object")
}

/// Return the total length of the upstream object.
pub fn len(&self) -> io::Result<usize> {
todo!("return upstream object length")
}

/// Convert this viewer into a chunked byte stream.
pub fn bytestream(&self) -> ByteStream {
todo!("convert viewer into a chunked byte stream")
}
}
Comment thread src/traits.rs
Comment on lines +18 to +27
pub trait Writer: Send + Sync {
/// Write bytes into the cache under `key`.
fn write(&self, key: &str) -> io::Result<()>;

/// Read a byte range from the cache.
fn read(&self, key: &str) -> io::Result<Option<Bytes>>;

/// Delete all cached data associated with `key`.
fn delete(&self, key: &str) -> io::Result<()>;
}
Comment thread src/types.rs
use bytes::Bytes;

/// Stream type for chunked byte output from a viewer.
pub type ByteStream = Pin<Box<dyn Iterator<Item = io::Result<Bytes>> + Send>>;
Comment on lines +27 to +29
- uses: Swatinem/rust-cache@v2
with:
shared-key: cargo-${{ inputs.runner }}
Comment on lines +25 to +27
- uses: Swatinem/rust-cache@v2
with:
shared-key: cargo-${{ inputs.runner }}
Comment on lines +20 to +21
`chunk_size`. However these are explained a bit further in the
[`Builder` docs](http://docs.rs/sparseio/latest/sparseio/struct.Builder.html).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants