Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ listed under a **Changed** or **Removed** heading.
cell and style assertions. Every Rust block in it is compiled against the
crate in CI, and the README shows the one-line install for Claude Code.

### Fixed

- **docs.rs labels APIs gated by the `decode` and `insta` features.** Optional
items no longer appear to be available in every build. (#258)

## [0.9.0] - 2026-09-05

### Added
Expand Down
1 change: 1 addition & 0 deletions crates/termlens/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ authors.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["insta"]
Expand Down
3 changes: 3 additions & 0 deletions crates/termlens/src/graphics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ impl GraphicsPayload {
/// size. [`DecodeError::TooLarge`] covers declared dimensions or sixel
/// commands beyond the 4096-pixel and related safety limits.
#[cfg(feature = "decode")]
#[cfg_attr(docsrs, doc(cfg(feature = "decode")))]
pub fn decode(&self) -> Result<Bitmap, DecodeError> {
let data = self.data.as_deref().ok_or(DecodeError::NotCaptured)?;
match self.protocol {
Expand Down Expand Up @@ -386,6 +387,7 @@ impl GraphicsPayload {
/// be about the picture — "the day at week 30 is Primer's brightest green" —
/// rather than about its size in bytes.
#[cfg(feature = "decode")]
#[cfg_attr(docsrs, doc(cfg(feature = "decode")))]
#[derive(Clone, PartialEq, Eq)]
pub struct Bitmap {
width: u32,
Expand Down Expand Up @@ -493,6 +495,7 @@ const MAX_SIXEL_REGISTERS: usize = 65_536;

/// Why a payload could not be decoded.
#[cfg(feature = "decode")]
#[cfg_attr(docsrs, doc(cfg(feature = "decode")))]
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum DecodeError {
Expand Down
4 changes: 4 additions & 0 deletions crates/termlens/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
//! override any of them.

#![warn(missing_docs)]
#![cfg_attr(docsrs, feature(doc_cfg))]

mod emu;
mod error;
Expand All @@ -117,6 +118,7 @@ mod wait;

pub use error::{Error, Result};
#[cfg(feature = "decode")]
#[cfg_attr(docsrs, doc(cfg(feature = "decode")))]
pub use graphics::{Bitmap, DecodeError};
pub use graphics::{
GraphicsAction, GraphicsFormat, GraphicsPayload, GraphicsProtocol, GraphicsSeen,
Expand All @@ -134,6 +136,7 @@ pub use terminal::{
/// default), so [`assert_screen_snapshot!`] always agrees with the `insta`
/// version doing the snapshotting.
#[cfg(feature = "insta")]
#[cfg_attr(docsrs, doc(cfg(feature = "insta")))]
pub use insta;

/// Snapshot-assert anything that displays like a [`Screen`].
Expand All @@ -152,6 +155,7 @@ pub use insta;
/// # }
/// ```
#[cfg(feature = "insta")]
#[cfg_attr(docsrs, doc(cfg(feature = "insta")))]
#[macro_export]
macro_rules! assert_screen_snapshot {
($screen:expr) => {
Expand Down