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 bits::EncodingModes;
29pub use cast::{As, Truncate};
30pub use limits::{DEFAULT_MAX_DATA_LENGTH, DEFAULT_MAX_RENDER_SIZE, ResourceLimits};
31pub use mode::{AlphanumericMode, ByteMode, EncodingMode, KanjiMode, NumericMode};
32pub use plugin::{
33    DynEncoder, DynRenderer, EncodeConfig, EncodedOutput, EncoderFactory, ModuleGrid, PluginError, PluginRegistry,
34    PostProcessor, QrPlugin, RenderConfig, RenderOutput, RendererFactory,
35};
36pub use traits::{Builder, Encoder, ModuleSource, ModuleStorage, ModuleView, QrCodeRef, QrSymbol, Renderer};
37pub use types::{Color, EcLevel, Mode, QrError, QrResult, Version};
38pub use version::{ConstVersion, StaticVersion};