NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #856 most downloaded on crates.io
Objective-C type-encoding representation and parsing
Last release 2 years ago
no release in 18 months
Ships fairly regularly
a new release about every 4 months
Nearly every release is documented
notes for 7 of 7 stable releases
1 version withdrawn
withdrawn after publishing
5 years old
18 releases · first in 2021
One column per quarter.
[4.1.0]: https://github.com/madsmtm/objc2/compare/objc2-encode-4.0.3...objc2-encode-4.1.0
Encoding::size, which computes the size of the encoded type for the
current target.Encoding::Class, Encoding::Object
and Encoding::Block as equivalent.[4.0.3]: https://github.com/madsmtm/objc2/compare/objc2-encode-4.0.2...objc2-encode-4.0.3
lints.workspace = true Cargo setup properly.[4.0.2]: https://github.com/madsmtm/objc2/compare/objc2-encode-4.0.1...objc2-encode-4.0.2
Added Encoding::None, which represents encodings where the host compiler
(i.e. clang) couldn't generate an encoding for a given type.
This is useful when working with SIMD types.
[4.0.1]: https://github.com/madsmtm/objc2/compare/objc2-encode-4.0.0...objc2-encode-4.0.1
[4.0.0]: https://github.com/madsmtm/objc2/compare/objc2-encode-3.0.0...objc2-encode-4.0.0
EncodingBox::Struct and
EncodingBox::Union to no longer contain an Option.[3.0.0]: https://github.com/madsmtm/objc2/compare/objc2-encode-2.0.0...objc2-encode-3.0.0
2.0.0.[2.0.0]: https://github.com/madsmtm/objc2/compare/objc2-encode-2.0.0-pre.4...objc2-encode-2.0.0
[2.0.0-pre.4]: https://github.com/madsmtm/objc2/compare/objc2-encode-2.0.0-pre.3...objc2-encode-2.0.0-pre.4
no_std compatible.Encode, RefEncode, EncodeArguments,
EncodeConvert, OptionEncode to objc2.Encoding::BitField now allows omitting the type using an
Option.Encoding::Array from usize to
u64 (to be platform-agnostic).Encoding::BitField encoding parsing.[2.0.0-pre.3]: https://github.com/madsmtm/objc2/compare/objc2-encode-2.0.0-pre.2...objc2-encode-2.0.0-pre.3
EncodingBox for dynamically parsing encodings and creating them on
the heap.ParseError, a custom type that represents errors during encoding
parsing.Encoding::equivalent_to_box for comparing Encoding and
EncodingBox.Encode and RefEncode for NonNull<c_void>.OptionEncode to help with implementing Encode and RefEncode for
Option.Encoding::Struct and
Encoding::Union is a valid C identifier.Encoding no longer implements Copy, though it is still
Clone.Encoding::equivalent_to_start_of_str, since it
wasn't really useful.[2.0.0-pre.2]: https://github.com/madsmtm/objc2/compare/objc2-encode-2.0.0-pre.1...objc2-encode-2.0.0-pre.2
EncodeConvert trait to help with correctly handling BOOL/bool.Encoding, since the non
-'static version was essentially useless.bool (and AtomicBool) no longer implements Encode, since
that was difficult to use correctly. See the EncodeConvert trait, or use
objc2::runtime::Bool instead.[2.0.0-pre.1]: https://github.com/madsmtm/objc2/compare/objc2-encode-2.0.0-pre.0...objc2-encode-2.0.0-pre.1
Encoding::Atomic.Encode and RefEncode for std::sync::atomic types.Encoding::C_U_LONG to Encoding::C_ULONG.[2.0.0-pre.0]: https://github.com/madsmtm/objc2/compare/objc2-encode-2.0.0-beta.2...objc2-encode-2.0.0-pre.0
Encoding::C_LONG and Encoding::C_U_LONG to help with platform
compatibility; use these instead of c_long::ENCODING and
c_ulong::ENCODING.Encode and RefEncode for MaybeUninit<T>, where T is
properly bound.EncodeArguments trait.Encoding::BitField.PartialEq impl between str and Encoding since it
was incorrect (it violated the trait requirements).Encode and RefEncode implementations for Pin
since it may not be sound.[2.0.0-beta.2]: https://github.com/madsmtm/objc2/compare/objc2-encode-2.0.0-beta.1...objc2-encode-2.0.0-beta.2
Hash for Encoding.[2.0.0-beta.1]: https://github.com/madsmtm/objc2/compare/objc2-encode-2.0.0-beta.0...objc2-encode-2.0.0-beta.1
Encoding::equivalent_to, Encoding::equivalent_to_str and
Encoding::equivalent_to_start_of_str methods for more precise comparison
semantics.Encode and RefEncode implementations for Option function
pointers.str with Encoding using PartialEq. This trait
impl might get removed in a future version.BREAKING: Make Encoding #[non_exhaustive]. This will help us in evolving the API while minimizing further breaking changes.
Encoding::LongDouble, Encoding::FloatComplex,
Encoding::DoubleComplex and Encoding::LongDoubleComplex.RefEncode for all number types that implement Encode (bool,
i8, usize, f32, NonZeroU32, and so on).RefEncode for *const c_void and *mut c_void (allowing
void** in C).Encode and RefEncode for Wrapping<T>, where T is properly
bound.Encoding #[non_exhaustive]. This will help us in
evolving the API while minimizing further breaking changes.bool::ENCODING; use objc2::Bool::ENCODING instead.()::ENCODING for anything other than as a function return
type.[2.0.0-alpha.1]: https://github.com/madsmtm/objc2/compare/objc2-encode-2.0.0-alpha.0...objc2-encode-2.0.0-alpha.1
RefEncode trait, which represents types whose pointers has an
encoding. This means you now only have to implement RefEncode, and not
both &Encode and &mut Encode.
Additionally, encodings of pointers to pointers (to pointers, and so on) are
now supported.Encode for NonZeroX and Option<NonZeroX> integer types.RefEncode for arrays.Encode and RefEncode for (where T is properly bound):
ManuallyDrop<T>Pin<T>NonNull<T>Option<NonNull<T>>EncodeArguments trait, to represent an ordered group of functions
arguments, where each argument has an Objective-C type-encoding.
Previously in the objc crate.Encode and RefEncode for some extern "C" fn pointers.BREAKING: Removed automatic *const T: Encode and *mut T: Encode
impls when when &T: Encode and &mut T: Encode was implemented.
Implement T: RefEncode instead!
[2.0.0-alpha.0]: https://github.com/madsmtm/objc2/compare/objc2-encode-1.1.0...objc2-encode-2.0.0-alpha.0
Encode for all array lengths using const-generics.Encode for unsized pointer types as well.objc2-encode.Encoding::BitField from u32 to u8.Encoding::Array from u32 to usize.'static bounds on references implementing Encode.[1.1.0]: https://github.com/madsmtm/objc2/compare/objc2-encode-1.0.0...objc2-encode-1.1.0
Encode for arrays with up to 32 elements.Your coding agent can read these notes before it upgrades. Set up the MCP server →