Skip to main content Crate simple_endian Copy item path Source encoding_rs text_encoding_rs and (text_fixed or text_utf16 or text_utf32 or text_utf8)Optional encoding_rs-backed helpers. utf8 text_utf8 and (text_fixed or text_utf16 or text_utf32 or text_utf8)UTF-8 helpers. BigEndian A big-endian representation of type T that implements SpecificEndian<T>. Data stored in the struct must be converted to big-endian using ::from() or .into(). FixedCodepointStr text_fixed and (text_fixed or text_utf16 or text_utf32 or text_utf8)A borrowed view of exactly N Unicode scalar values. FixedCodepointString text_fixed and (text_fixed or text_utf16 or text_utf32 or text_utf8)A fixed-length string of exactly N Unicode scalar values (codepoints). FixedUtf8Bytes text_fixed and text_utf8 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Inline, fixed-size UTF-8 bytes. FixedUtf8BytesRef text_fixed and text_utf8 and (text_fixed or text_utf16 or text_utf32 or text_utf8)A borrowed reference to exactly N UTF-8 bytes. FixedUtf8NullPadded text_fixed and text_utf8 and (text_fixed or text_utf16 or text_utf32 or text_utf8)NUL-padded fixed UTF-8 bytes. FixedUtf8SpacePadded text_fixed and text_utf8 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Space-padded fixed UTF-8 bytes. FixedUtf16BeNullPadded text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Fixed UTF-16BE code units interpreted as a NUL-padded string. FixedUtf16BePacked text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Fixed UTF-16BE code units interpreted as a packed string. FixedUtf16BeSpacePadded text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Fixed UTF-16BE code units interpreted as a space-padded string. FixedUtf16CodeUnitsEndian text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Inline, fixed-size UTF-16 code units stored with explicit endianness. FixedUtf16CodeUnitsRefEndian text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)A borrowed reference to exactly N UTF-16 code units stored with explicit endianness. FixedUtf16LeNullPadded text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Fixed UTF-16LE code units interpreted as a NUL-padded string. FixedUtf16LePacked text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Fixed UTF-16LE code units interpreted as a packed string. FixedUtf16LeSpacePadded text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Fixed UTF-16LE code units interpreted as a space-padded string. FixedUtf32BeNullPadded text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Fixed UTF-32BE code units interpreted as a NUL-padded string. FixedUtf32BePacked text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Fixed UTF-32BE code units interpreted as a packed string. FixedUtf32BeSpacePadded text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Fixed UTF-32BE code units interpreted as a space-padded string. FixedUtf32CodeUnitsEndian text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Inline, fixed-size UTF-32 code units stored with explicit endianness. FixedUtf32CodeUnitsRefEndian text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)A borrowed reference to exactly N UTF-32 code units stored with explicit endianness. FixedUtf32LeNullPadded text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Fixed UTF-32LE code units interpreted as a NUL-padded string. FixedUtf32LePacked text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Fixed UTF-32LE code units interpreted as a packed string. FixedUtf32LeSpacePadded text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Fixed UTF-32LE code units interpreted as a space-padded string. LittleEndian A little-endian representation of type T that implements SpecificEndian<T>. Data stored in the struct must be converted to little-endian using ::from() or .into(). Utf16StrBE text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Borrowed UTF-16 code units (big-endian encoded u16). Utf16StrLE text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Borrowed UTF-16 code units (little-endian encoded u16). Utf16StringBE text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Owned UTF-16 code units (big-endian u16). Utf16StringLE text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Owned UTF-16 code units (little-endian u16). Utf32StrBE text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Borrowed UTF-32 code units (big-endian encoded u32). Utf32StrLE text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Borrowed UTF-32 code units (little-endian encoded u32). Utf32StringBE text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Owned UTF-32 code units (big-endian u32). Utf32StringLE text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Owned UTF-32 code units (little-endian u32). Endian Any object implementing SpecificEndian<T> can be converted between big and little endian. Implement this trait to allow for endian conversion by this crate. EndianValue io-core and (io-core or io-std)Read raw bytes into a BigEndian<T>. FixedTextError text_fixed and (text_fixed or text_utf16 or text_utf32 or text_utf8)Error returned when converting into a fixed-codepoint string fails. FixedUtf8Error text_fixed and text_utf8 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Errors for fixed UTF-8 byte storage. FixedUtf16Error text_fixed and (text_fixed or text_utf16 or text_utf32 or text_utf8)Errors for fixed UTF-16 code-unit storage. FixedUtf32Error text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Errors for fixed UTF-32 code-unit storage. Utf16Error text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Errors returned when decoding UTF-16. Utf32Error text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Errors returned when decoding UTF-32. EndianRead io-std and (io-core or io-std)EndianRepr io-core and (io-core or io-std)EndianWrite io-std and (io-core or io-std)FromSlice io-core and (io-core or io-std)Trait describing types that can be read from / written to a byte slice
representation. Implemented for BigEndian<T> and LittleEndian<T>. SimpleEndian A trait for types that do not change based on endianness. SpecificEndian SpecificEndianOwned Endian conversion trait for owned / non-Copy types. from_bytes io-core and (io-core or io-std)Read raw bytes and return an EndianValue<T> chosen by
T::default().endian(). from_bytes_to_native io-core and (io-core or io-std)Convenience: read bytes and return the host-native T directly. read_from_slice io-core and (io-core or io-std)Convenience generic helpers. read_native io-std and (io-core or io-std)Read a value in its wire representation and convert it into a native type. read_specific io-std and (io-core or io-std)Read an endian-aware value of type E from a reader. read_specific_dyn io-std and (io-core or io-std)Dyn-friendly adapter for read_specific. try_read_native io-std and (io-core or io-std)Like read_native , but uses TryFrom<W> for fallible conversion. try_write_native io-std and (io-core or io-std)Like write_native , but uses TryFrom<T> for fallible conversion. try_write_native_ref io-std and (io-core or io-std)Convenience wrapper over try_write_native when you only have a reference. write_native io-std and (io-core or io-std)Convert a native value into its wire representation and write it. write_native_ref io-std and (io-core or io-std)Convenience wrapper over write_native when you only have a reference. write_specific io-std and (io-core or io-std)Write an endian-aware value of type E to a writer. write_specific_dyn io-std and (io-core or io-std)Dyn-friendly adapter for write_specific. write_to_extend io-core and (io-core or io-std)FixedUtf16BeCodeUnits text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Big-endian fixed UTF-16 code units. FixedUtf16BeCodeUnitsRef text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)A borrowed reference to exactly N UTF-16BE code units. FixedUtf16CodeUnits Little-endian and text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8) Host-endian fixed UTF-16 code units. FixedUtf16CodeUnitsRef Little-endian and text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8) A borrowed reference to exactly N host-endian UTF-16 code units. FixedUtf16LeCodeUnits text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Little-endian fixed UTF-16 code units. FixedUtf16LeCodeUnitsRef text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)A borrowed reference to exactly N UTF-16LE code units. FixedUtf16LeNullTerminated Deprecated text_fixed and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Backwards-compatible name for FixedUtf16LeNullPadded . FixedUtf32BeCodeUnits text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)FixedUtf32BeCodeUnitsRef text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)FixedUtf32CodeUnits Little-endian and text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8) Host-endian fixed UTF-32 code units. FixedUtf32CodeUnitsRef Little-endian and text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8) A borrowed reference to exactly N host-endian UTF-32 code units. FixedUtf32LeCodeUnits text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)FixedUtf32LeCodeUnitsRef text_fixed and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8)Utf16Str Little-endian and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8) Utf16String Little-endian and text_utf16 and (text_fixed or text_utf16 or text_utf32 or text_utf8) Utf32Str Little-endian and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8) Utf32String Little-endian and text_utf32 and (text_fixed or text_utf16 or text_utf32 or text_utf8) f32be Shorthand for BigEndian<f32> f32le Shorthand for LittleEndian<f32> f64be Shorthand for BigEndian<f64> f64le Shorthand for LittleEndian<f64> i16be Shorthand for BigEndian<i16> i16le Shorthand for LittleEndian<i16> i32be Shorthand for BigEndian<i32> i32le Shorthand for LittleEndian<i32> i64be Shorthand for BigEndian<i64> i64le Shorthand for LittleEndian<i64> i128be Shorthand for BigEndian<i128> i128le Shorthand for LittleEndian<i128> isizebe Shorthand for BigEndian<isize> isizele Shorthand for LittleEndian<isize> nzi8be integer_impls and nonzeroShorthand for BigEndian<NonZeroI8> nzi8le integer_impls and nonzeroShorthand for LittleEndian<NonZeroI8> nzi16be integer_impls and nonzeroShorthand for BigEndian<NonZeroI16> nzi16le integer_impls and nonzeroShorthand for LittleEndian<NonZeroI16> nzi32be integer_impls and nonzeroShorthand for BigEndian<NonZeroI32> nzi32le integer_impls and nonzeroShorthand for LittleEndian<NonZeroI32> nzi64be integer_impls and nonzeroShorthand for BigEndian<NonZeroI64> nzi64le integer_impls and nonzeroShorthand for LittleEndian<NonZeroI64> nzi128be integer_impls and nonzeroShorthand for BigEndian<NonZeroI128> nzi128le integer_impls and nonzeroShorthand for LittleEndian<NonZeroI128> nzisizebe integer_impls and nonzeroShorthand for BigEndian<NonZeroIsize> nzisizele integer_impls and nonzeroShorthand for LittleEndian<NonZeroIsize> nzu8be integer_impls and nonzeroShorthand for BigEndian<NonZeroU8> nzu8le integer_impls and nonzeroShorthand for LittleEndian<NonZeroU8> nzu16be integer_impls and nonzeroShorthand for BigEndian<NonZeroU16> nzu16le integer_impls and nonzeroShorthand for LittleEndian<NonZeroU16> nzu32be integer_impls and nonzeroShorthand for BigEndian<NonZeroU32> nzu32le integer_impls and nonzeroShorthand for LittleEndian<NonZeroU32> nzu64be integer_impls and nonzeroShorthand for BigEndian<NonZeroU64> nzu64le integer_impls and nonzeroShorthand for LittleEndian<NonZeroU64> nzu128be integer_impls and nonzeroShorthand for BigEndian<NonZeroU128> nzu128le integer_impls and nonzeroShorthand for LittleEndian<NonZeroU128> nzusizebe integer_impls and nonzeroShorthand for BigEndian<NonZeroUsize> nzusizele integer_impls and nonzeroShorthand for LittleEndian<NonZeroUsize> u16be Shorthand for BigEndian<u16> u16le Shorthand for LittleEndian<u16> u32be Shorthand for BigEndian<u32> u32le Shorthand for LittleEndian<u32> u64be Shorthand for BigEndian<u64> u64le Shorthand for LittleEndian<u64> u128be Shorthand for BigEndian<u128> u128le Shorthand for LittleEndian<u128> usizebe Shorthand for BigEndian<usize> usizele Shorthand for LittleEndian<usize> Endianize deriveGenerate a “wire-format” struct and endian wrapper aliases.