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 mode;
21pub mod optimize;
22pub mod plugin;
23pub mod traits;
24pub mod types;
25pub mod version;
26
27pub use cast::{As, Truncate};
28pub use mode::{AlphanumericMode, ByteMode, EncodingMode, KanjiMode, NumericMode};
29pub use plugin::{
30    DynEncoder, DynRenderer, EncodeConfig, EncodedOutput, EncoderFactory, ModuleGrid, PluginError, PluginRegistry,
31    PostProcessor, QrPlugin, RenderConfig, RenderOutput, RendererFactory,
32};
33pub use traits::{Builder, Encoder, ModuleSource, ModuleStorage, ModuleView, QrCodeRef, QrSymbol, Renderer};
34pub use types::{Color, EcLevel, Mode, QrError, QrResult, Version};
35pub use version::{ConstVersion, StaticVersion};