Skip to main content

qrcode_core/
lib.rs

1//! Zero-dependency QR code encoding core (`no_std` + `alloc`) for `qrcode-rs`.
2//!
3//! Holds the encoding primitive layer — bit-stream construction ([`bits::Bits`]),
4//! mode optimization ([`optimize`]), Reed–Solomon error correction ([`ec`]),
5//! and module-grid canvas drawing ([`canvas`]) — plus the shared types
6//! ([`types`]) and checked-cast helpers ([`cast`]), with no external crate
7//! dependencies. The `qrcode-rs` facade crate depends on this and re-exports
8//! its public surface; embedders wanting only the encoder (no rendering or
9//! image dependencies) can depend on `qrcode-core` directly.
10
11#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
12#![deny(missing_docs)]
13
14extern crate alloc;
15
16pub mod bits;
17pub mod canvas;
18pub mod cast;
19pub mod ec;
20pub mod limits;
21pub mod mode;
22pub mod optimize;
23pub mod plugin;
24pub mod traits;
25pub mod types;
26pub mod version;
27
28pub use cast::{As, Truncate};
29pub use limits::{DEFAULT_MAX_DATA_LENGTH, DEFAULT_MAX_RENDER_SIZE, ResourceLimits};
30pub use mode::{AlphanumericMode, ByteMode, EncodingMode, KanjiMode, NumericMode};
31pub use plugin::{
32    DynEncoder, DynRenderer, EncodeConfig, EncodedOutput, EncoderFactory, ModuleGrid, PluginError, PluginRegistry,
33    PostProcessor, QrPlugin, RenderConfig, RenderOutput, RendererFactory,
34};
35pub use traits::{Builder, Encoder, ModuleSource, ModuleStorage, ModuleView, QrCodeRef, QrSymbol, Renderer};
36pub use types::{Color, EcLevel, Mode, QrError, QrResult, Version};
37pub use version::{ConstVersion, StaticVersion};