// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // Copyright by contributors to this project. // SPDX-License-Identifier: (Apache-2.0 OR MIT)
/// Optimized encoding and decoding for types that can be represented by `Vec<u8>`. /// /// Compatible with derive macros by using `mls_codec(with = "mls_rs_codec::byte_vec")` pubmod byte_vec;
pubmod iter;
mod cow; mod map; mod option; mod stdint; mod string; mod tuple; mod varint; mod vec;
pubuse varint::*;
pubuse mls_rs_codec_derive::*;
#[derive(Debug)] #[cfg_attr(feature = "std", derive(thiserror::Error))] #[non_exhaustive] pubenum Error { #[cfg_attr(feature = "std", error("Integer out of range for VarInt"))]
VarIntOutOfRange, #[cfg_attr(feature = "std", error("Invalid varint prefix {0}"))]
InvalidVarIntPrefix(u8), #[cfg_attr(feature = "std", error("VarInt does not use the min-length encoding"))]
VarIntMinimumLengthEncoding, #[cfg_attr(feature = "std", error("UnexpectedEOF"))]
UnexpectedEOF, #[cfg_attr(feature = "std", error("Option marker out of range: {0}"))]
OptionOutOfRange(u8), #[cfg_attr(feature = "std", error("Unsupported enum discriminant"))]
UnsupportedEnumDiscriminant, #[cfg_attr(feature = "std", error("Expected UTF-8 string"))]
Utf8, #[cfg_attr(feature = "std", error("mls codec error: {0}"))]
Custom(u8),
}
/// Trait that determines the encoded length in MLS encoding. pubtrait MlsSize { fn mls_encoded_len(&self) -> usize;
}
impl<T> MlsSize for &T where
T: MlsSize + ?Sized,
{ #[inline] fn mls_encoded_len(&self) -> usize {
(*self).mls_encoded_len()
}
}
/// Trait to support serializing a type with MLS encoding. pubtrait MlsEncode: MlsSize { fn mls_encode(&self, writer: &mut Vec<u8>) -> Result<(), Error>;
/// Trait to support deserialzing to a type using MLS encoding. pubtrait MlsDecode: Sized { fn mls_decode(reader: &mut &[u8]) -> Result<Self, Error>;
}
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.1Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-06-18)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.