candid
Candid is an interface description language (IDL) for interacting with canisters running on the Internet Computer.
0.10.35
4.9M downloads/mo
#4567 most downloaded on crates.io
dfinity/candid
What this package is like to depend on
Last release 12 days ago
11 Aug 2026
Release timing varies
gaps range from 2 weeks to 4 months
Some releases are documented
notes for 42 of 109 stable releases
4 versions withdrawn
withdrawn after publishing
6 years old
119 releases · first in 2020
18 releases in the last 12 months
see the full history below
Release timeline
119 releases · May 2020 to Aug 2026Releases
latest 60 of 119-
0.10.3511 Aug 2026Release notes
Open source →- Bug fixes:
- Bound the allocation when reading a length-prefixed byte field in the type-table header. A byte vector (a future type's payload, or a service method's name) previously reserved its full declared length up front, so a length larger than the remaining input requested a correspondingly large allocation instead of failing on the short read. These fields now grow their buffer incrementally, so an out-of-range or truncated length surfaces as an ordinary parse error. The wire format is unchanged and valid messages decode identically.
2026-07-27
- Bug fixes:
-
0.10.3427 Jul 2026Release notes
Open source →- Bug fixes:
- Fix decoding a
vecof fixed-width primitives into newtype elements (e.g.struct EventIndex(u32)), which failed with a spurious subtyping error since 0.10.27. The bulk decode fast path fed each element through serde's value deserializers, which do not implementdeserialize_newtype_struct; they now go through a wrapper that forwards it, as the main deserializer does. Nested newtypes are unwrapped recursively. - Fix
is_human_readable()reportingtruefor elements of avecof fixed-width primitives, also since 0.10.27. The bulk decode fast path inherited serde's default from the same value deserializers, so aDeserializeimpl that branches on it took its human-readable path inside avecwhile taking the binary path everywhere else, silently decoding to a different value with no error. It now reportsfalsefor the whole decoder, as candid is a binary format.
- Fix decoding a
- Bug fixes:
-
0.10.3327 Jul 2026Release notes
Open source →-
Breaking changes:
-
Migrated from the deprecated
binreadcrate to its successorbinrw. The types in thecandid::binary_parsermodule (Header,PrincipalBytes,Len,BoolValue) now implementbinrw::BinReadinstead ofbinread::BinRead, andFrom<binread::Error> for candid::Erroris replaced byFrom<binrw::Error>.Released as a patch rather than a minor bump because the affected surface is limited to those trait impls.
binary_parseris an internal wire-format parsing module that ispubonly incidentally — it is used nowhere outside candid's own deserializer, and it is now#[doc(hidden)]to say so. Code is affected only if it depends onbinreaddirectly and names these impls; the wire format, decoder error messages, byte offsets, type layouts, and all function signatures are unchanged, so the worst case is a compile error rather than a behaviour change.
-
-
Non-breaking changes:
- Decoding is faster as a side effect of the
binrwmigration, which dropsbinread'sdebug_templatecodegen: up to 37% fewer instructions on variant-heavy payloads (multi_arg−36.6%,result_variant−10.3%,large_variant−9.5%,subtype_decode−8.0%,double_option−7.0%), with no regressions. - Dropped the duplicate
syn 1.xdependency tree thatbinread_derivepinned (along withrustversion). - A future unrecognized
binrw::Errorvariant now degrades to a label-less error instead of panicking, sincebinrw::Erroris#[non_exhaustive]and decoding runs on untrusted input.
- Decoding is faster as a side effect of the
2026-07-06
-
-
0.10.3206 Jul 2026Release notes
Open source →- Non-breaking changes:
- A service reference now decodes where a
principalis expected:service <actortype>is a subtype ofprincipal(spec addition:service <: principal, modelled analogously tonat <: int). The subtype checker and the deserializer accept a service reference at typeprincipal; the two share an identical wire encoding, so the coercion is the identity on the reference. The reverse (aprincipalat aservicetype) remains rejected.
- A service reference now decodes where a
2026-07-03
- Non-breaking changes:
-
0.10.3125 Jun 2026Release notes
Open source →- Non-breaking changes:
- Encode and decode large
Nat/Intvalues in linear time. Values beyond theu64/i64fast path were previously processed one LEB128/SLEB128 group at a time, shifting the whole bignum on every byte (O(n²) in the encoded length); they now build the value in a single O(n) pass.
- Encode and decode large
- Non-breaking changes:
-
0.10.3023 Jun 2026Release notes
Open source →- Non-breaking changes:
- Add
pretty::utils::sep_encloseandsep_enclose_space: list/tuple pretty-printing combinators that separate items and enclose them in delimiters, emitting a trailing separator on multi-line layouts. - Add
TypeEnv::to_sorted_iter()to iterate bindings in a deterministic, key-sorted order.
- Add
- Non-breaking changes:
-
0.10.2927 May 2026Release notes
Open source →- Bug fixes:
- Fix
text_fast_pathleakage between nested maps: an inner map with non-text keys would fail with a "Type mismatch" error when enclosed in an outer map with text keys
- Fix
2026-05-20
- Bug fixes:
-
0.10.2820 May 2026Release notes
Open source →- Bug fixes:
- Fix LEB128/SLEB128 fast path silently truncating
Nat/Intvalues near theu64/i64boundary during decoding - Fix
Int::decodetruncating large magnitudes due to fast-path leakage
- Fix LEB128/SLEB128 fast path silently truncating
- Bug fixes:
-
0.10.2708 Apr 2026 withdrawnRelease notes
Open source →- Non-breaking changes:
- Add
subtype_check_all()to collect all subtype errors in one pass (previously stopped at the first) - Add
Incompatibilitytype andformat_report()for structured, hierarchical error reporting
- Add
2026-03-18
- Non-breaking changes:
-
0.10.2618 Mar 2026Release notes
Open source →- Bug fixes:
- Fix decoding failure when a trailing argument is a primitive vector
2026-03-16
- Bug fixes:
-
0.10.2516 Mar 2026Release notes
Open source →- Non-breaking changes:
- Preserve Rust doc comments on exported Candid types, record fields, and variant members when generating
.didfiles via#[derive(CandidType)]
- Preserve Rust doc comments on exported Candid types, record fields, and variant members when generating
2026-02-27
- Non-breaking changes:
-
0.10.2427 Feb 2026Release notes
Open source →- Non-breaking changes:
- Implement
DataSizeforPrincipal, enablingPrincipalas an element type inBoundedVec
- Implement
2026-02-20
- Non-breaking changes:
-
0.10.2320 Feb 2026Release notes
Open source →- Non-breaking changes:
- Add
BoundedVectype tocandid::types::bounded_vecfor bounding a vector by number of elements, total data size, and per-element data size during deserialization
- Add
2026-02-10
- Non-breaking changes:
-
0.10.2210 Feb 2026Release notes
Open source →- Non-breaking changes:
- Enhance recursion guard
- Use
target_family = "wasm"for platform detection to cover both wasm32 and wasm64; skip recursion check on wasm (sandboxed), use stack-based check on native platforms and a conservative depth limit on other niche platforms - Apply recursion guard to all recursive functions on deserialization path: type environment operations (
TypeEnv::is_empty,trace_type,rec_find_type,as_func,as_service), value type annotation (IDLValue::annotate_type), subtype checking (subtype_(),equal()), and all deserializer methods (deserialize_option,deserialize_seq,deserialize_map,deserialize_tuple,deserialize_tuple_struct,deserialize_struct,deserialize_enum) - Refactor to use RAII guard pattern (
RecursionDepthwithDepthGuard) for automatic depth management, eliminating manual increment/decrement operations
- Use
- Enhance recursion guard
2026-02-03
- Non-breaking changes:
-
0.10.2103 Feb 2026Release notes
Open source →- Non-breaking changes:
- Add
max_type_lentoDecoderConfigto configure the type table size limit (default: 10,000) during binary parsing.
- Add
2026-01-09
- Non-breaking changes:
-
0.10.2016 Oct 2025Release notes
Open source →- Non-breaking changes:
- fix: subtyping and coercion rules for optional types
- fix: coercion of values into nested optional types
- fix: values of types
reservedat any context do not coerce into values of typenull - fix: missing record fields of type
nullin the textual format are decoded into a default value
- Non-breaking changes:
-
0.10.1916 Sep 2025Release notes
Open source →- Non-breaking changes:
- Fixes a compatibility issue with
serdev1.0.220 and later.
- Fixes a compatibility issue with
2025-09-03
- Non-breaking changes:
-
0.10.1803 Sep 2025Release notes
Open source →- Non-breaking changes:
- Implement
serde::SerializeandPartialOrd,Ord,Hashfor theReservedtype.
- Implement
2025-08-04
- Non-breaking changes:
-
0.10.1704 Aug 2025Release notes
Open source →- Non-breaking changes:
- Fixes a regression in pretty printing when concatenating an empty list of documents
2025-07-29
- Non-breaking changes:
-
0.10.1629 Jul 2025Release notes
Open source →- Non-breaking changes:
- Makes the warning message for the special opt subtyping rule more explicit in the
candid::types::subtype::subtypeandcandid::types::subtype::subtype_with_configfunctions. - Added
pp_label_rawinpretty::candidmodule.
- Makes the warning message for the special opt subtyping rule more explicit in the
- Non-breaking changes:
-
0.10.1525 Jul 2025 withdrawnNothing published for this version
-
0.10.1416 May 2025Release notes
Open source →- Add a series of decoder functions which provide convenience for ic-cdk macros usage.
2025-01-22
-
0.10.1322 Jan 2025Release notes
Open source →- Add
ArgumentEncoder::encode_ref,utils::{write_args, encode_args}that don't consume the value when encoding.
2025-01-15
- Add
-
0.10.1215 Jan 2025 -
0.10.1110 Dec 2024Release notes
Open source →- Add
IDLBuilder.try_reserve_value_serializer_capacity()to reserve capacity before serializing a large amount of data.
2024-05-03
- Add
-
0.10.1029 Jul 2024Release notes
Open source →- Add
candid::MotokoResulttype. Usemotoko_result.into_result()to convert the value into Rust result, andrust_result.into()to get Motoko result.
- Add
-
0.10.920 Jun 2024Nothing published for this version
-
0.10.803 May 2024Nothing published for this version
-
0.10.711 Apr 2024Nothing published for this version
-
0.10.625 Mar 2024Nothing published for this version
-
0.10.508 Mar 2024Release notes
Open source →- Switch
HashMaptoBTreeMapin serialization andT::ty(). This leads to around 20% perf improvement for serializing complicated types. - Disable memoization for unrolled types in serialization to save cycle cost. In some cases, type table can get slightly larger, but it's worth the trade off.
- Fix bug in
text_size - Fix decoding cost calculation overflow
- Fix length check in decoding principal type
- Implement
CandidTypeforserde_bytes::ByteArray - Add
pretty::candid::pp_init_argsfunction to pretty print init args
2024-02-27
- Switch
-
0.10.427 Feb 2024Release notes
Open source →- Support
#[serde(rename = "")]with arbitrary string. - Fix a performance bug in the type table parsing.
- Allow setting decoding quota for deserialization with the following new functions:
candid::decode_args_with_config,candid::utils::decode_args_with_config_debug,candid::decode_one_with_config,candid::Decode!([config]; &bytes, T),candid::Decode!(@Debug [config]; &bytes, T),IDLArgs::from_bytes_with_types_with_configandIDLArgs::from_bytes_with_config. The original decoding method remains to be non-metered.
- Support
-
0.10.330 Jan 2024 -
0.10.203 Jan 2024 -
0.10.115 Dec 2023Release notes
Open source →- Add
candid::types::value::try_from_candid_typeto convert Rust type toIDLValue. - Display
IDLValue::Blobin ascii character only when the whole blob are ascii characters.
- Add
-
0.10.016 Nov 2023Nothing published for this version
-
0.9.1123 Oct 2023Nothing published for this version
-
0.9.1017 Oct 2023Nothing published for this version
-
0.9.904 Oct 2023Nothing published for this version
-
0.9.827 Sep 2023Release notes
Open source →- Implement
CandidTypeforstd::cmp::Reverse. - Rust codegen: add
pubfor struct fields. - Fix
merge_init_typesandinstantiate_candidwhen the main actor refers to a variable.
- Implement
-
0.9.720 Sep 2023Nothing published for this version
-
0.9.606 Sep 2023Nothing published for this version
-
0.9.530 Aug 2023Nothing published for this version
-
0.9.430 Aug 2023Nothing published for this version
-
0.9.303 Aug 2023Nothing published for this version
-
0.9.225 Jul 2023Nothing published for this version
-
0.9.111 Jul 2023Nothing published for this version
-
0.9.001 Jul 2023Nothing published for this version
-
0.9.0-beta.423 May 2023 pre-releaseNothing published for this version
-
0.9.0-beta.313 Apr 2023 pre-releaseNothing published for this version
-
0.9.0-beta.203 Feb 2023 pre-releaseNothing published for this version
-
0.9.0-beta.101 Feb 2023 pre-releaseNothing published for this version
-
0.9.0-beta.028 Jan 2023 pre-releaseNothing published for this version
-
0.8.417 Nov 2022Nothing published for this version
-
0.8.315 Oct 2022Nothing published for this version
-
0.8.206 Oct 2022Nothing published for this version
-
0.8.104 Oct 2022Nothing published for this version
-
0.8.028 Sep 2022Nothing published for this version
-
0.7.1827 Sep 2022Nothing published for this version
-
0.7.1722 Sep 2022Nothing published for this version