### Define START constant in Rust Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/marker/constant.START.html?search= The START constant is defined as a u8 value of 0x1f. ```rust pub const START: u8 = 0x1f; ``` -------------------------------- ### IoWriter::new Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/utils/struct.IoWriter.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new instance of IoWriter wrapping the provided writer. ```APIDOC ## pub fn new(writer: W) -> Self ### Description Creates a new IoWriter instance that wraps a writer of type W. ### Parameters - **writer** (W) - Required - The writer to be wrapped. ``` -------------------------------- ### IoWriter::new Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/utils/struct.IoWriter.html?search=std%3A%3Avec Creates a new instance of IoWriter wrapping the provided writer. ```APIDOC ## pub fn new(writer: W) -> Self ### Description Creates a new IoWriter instance that wraps the given writer. ### Parameters - **writer** (W) - Required - The writer to be wrapped. ``` -------------------------------- ### Reference::take Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/dec/enum.Reference.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new Reference by taking a specified length from the current reference. ```APIDOC ## pub fn take(&self, len: usize) -> Reference<'de, 'short> ### Description Creates a new Reference instance by taking a slice of the specified length from the current reference. ### Parameters - **len** (usize) - The length of the byte slice to take. ### Returns - **Reference<'de, 'short>** - A new Reference instance. ``` -------------------------------- ### BufWriter::new Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/utils/struct.BufWriter.html?search=std%3A%3Avec Creates a new instance of BufWriter initialized with the provided vector of bytes. ```APIDOC ## pub fn new(buf: Vec) -> Self ### Description Creates a new in-memory writer using the provided vector as the initial buffer. ### Parameters - **buf** (Vec) - Required - The initial byte vector for the writer. ``` -------------------------------- ### BufWriter::new Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/utils/struct.BufWriter.html?search=u32+-%3E+bool Creates a new instance of BufWriter initialized with the provided vector of bytes. ```APIDOC ### pub fn new(buf: Vec) -> Self Creates a new writer instance. ``` -------------------------------- ### Len::new Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/error/enum.Len.html Creates a new Len instance based on the provided usize length. ```APIDOC ## pub fn new(len: usize) -> Len ### Description Creates a new `Len` instance from a `usize` value. This is the primary constructor for determining the appropriate `Len` variant. ### Parameters - **len** (usize) - Required - The length value to convert into a `Len` enum variant. ``` -------------------------------- ### IoReader::new Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/utils/struct.IoReader.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new instance of IoReader wrapping the provided reader. ```APIDOC ## pub fn new(reader: R) -> Self ### Description Creates a new IoReader instance that wraps a reader implementing std::io::BufRead. ### Parameters - **reader** (R) - The reader to be wrapped. ``` -------------------------------- ### fn push(&mut self, input: &[u8]) -> Result<(), Self::Error> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/enc/trait.Write.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Writes all data from the provided byte slice to the underlying writer. ```APIDOC ## fn push(&mut self, input: &[u8]) -> Result<(), Self::Error> ### Description Writes all data from the provided byte slice to the underlying writer. This method is required for any type implementing the Write trait. ### Parameters - **input** (&[u8]) - Required - The byte slice containing the data to be written. ### Returns - **Result<(), Self::Error>** - Returns Ok(()) on success, or an implementation-defined error if the write operation fails. ``` -------------------------------- ### Serializer::new Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Serializer.html?search=std%3A%3Avec Creates a new Serializer instance that writes to the provided writer. ```APIDOC ### pub fn new(writer: W) -> Serializer Creates a new `Serializer` that will write serialized data to the given `writer`. ``` -------------------------------- ### serialize_struct Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Serializer.html?search=u32+-%3E+bool Begin to serialize a struct. ```APIDOC ## fn serialize_struct(self, _name: &'static str, len: usize) -> Result ### Description Begin to serialize a struct like `struct Rgb { r: u8, g: u8, b: u8 }`. This call must be followed by zero or more calls to `serialize_field`, then a call to `end`. ``` -------------------------------- ### Reference::as_ref Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/dec/enum.Reference.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Returns a reference to the underlying byte slice. ```APIDOC ## pub const fn as_ref(&self) -> &[u8] ### Description Returns the byte slice contained within the Reference. ### Returns - **&[u8]** - The byte slice. ``` -------------------------------- ### ArrayStart Struct Definition Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/dec/struct.ArrayStart.html The definition of the ArrayStart struct, which wraps an optional usize representing the array length. ```rust pub struct ArrayStart(pub Option); ``` -------------------------------- ### SliceReader::new Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/utils/struct.SliceReader.html?search= Creates a new SliceReader instance from a byte slice. ```APIDOC ## pub fn new(buf: &[u8]) -> SliceReader<'_> ### Description Creates a new in-memory reader initialized with the provided byte slice. ### Parameters - **buf** (&[u8]) - Required - The byte slice to read from. ``` -------------------------------- ### serialize_tuple Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Serializer.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Begins the serialization of a statically sized sequence. ```APIDOC ## fn serialize_tuple(self, len: usize) -> Result ### Description Begins the serialization of a statically sized sequence whose length is known at deserialization time. This call must be followed by zero or more calls to `serialize_element`, then a call to `end`. ``` -------------------------------- ### serde::to_writer Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/all.html Serializes a value into a CBOR-encoded format and writes it to an IO writer. ```APIDOC ## serde::to_writer ### Description Serializes a value into a CBOR-encoded format and writes it to an IO writer. ### Signature `pub fn to_writer(writer: W, value: &T) -> Result<(), EncodeError> where T: Serialize, W: Write` ``` -------------------------------- ### serialize_map Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Serializer.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Begins the serialization of a map. ```APIDOC ## fn serialize_map(self, len: Option) -> Result ### Description Begins the serialization of a map. This call must be followed by zero or more calls to `serialize_key` and `serialize_value`, then a call to `end`. ``` -------------------------------- ### Len Constructor Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/error/enum.Len.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Constructor method for creating a Len instance from a usize value. ```rust pub fn new(len: usize) -> Len ``` -------------------------------- ### pub fn to_writer(writer: W, value: &T) -> Result<(), EncodeError> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.to_writer.html?search=u32+-%3E+bool Serializes a value to a writer. ```APIDOC ## Function: to_writer ### Description Serializes a value to a writer. ### Signature `pub fn to_writer(writer: W, value: &T) -> Result<(), EncodeError>` ### Constraints - `W: Write` - `T: Serialize` ### Parameters - **writer** (W) - The writer to which the value will be serialized. - **value** (&T) - A reference to the value to be serialized. ``` -------------------------------- ### serialize_tuple_struct Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Serializer.html?search=u32+-%3E+bool Begin to serialize a tuple struct. ```APIDOC ## fn serialize_tuple_struct(self, _name: &'static str, len: usize) -> Result ### Description Begin to serialize a tuple struct like `struct Rgb(u8, u8, u8)`. This call must be followed by zero or more calls to `serialize_field`, then a call to `end`. ``` -------------------------------- ### serialize_seq Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Serializer.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Begins the serialization of a variably sized sequence. ```APIDOC ## fn serialize_seq(self, len: Option) -> Result ### Description Begins the serialization of a variably sized sequence. This call must be followed by zero or more calls to `serialize_element`, then a call to `end`. ``` -------------------------------- ### IoReader::into_inner Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/utils/struct.IoReader.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Consumes the IoReader and returns the inner reader. ```APIDOC ## pub fn into_inner(self) -> R ### Description Consumes the IoReader instance and returns the underlying reader that was wrapped during initialization. ``` -------------------------------- ### Deserializer::new Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Deserializer.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new Deserializer instance from a reader. ```APIDOC ## pub fn new(reader: R) -> Deserializer ### Description Creates a new `Deserializer` that reads from the provided `reader`. ### Parameters - **reader** (R) - The input source to deserialize from. ``` -------------------------------- ### Deserializer::new Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Deserializer.html Creates a new Deserializer instance from a reader. ```APIDOC ## pub fn new(reader: R) -> Deserializer ### Description Creates a new Deserializer that will read data from the provided reader. ### Parameters - **reader** (R) - The input source to deserialize from. ``` -------------------------------- ### pub fn high(byte: u8) -> u8 Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/dec/fn.high.html?search=std%3A%3Avec This function accepts a u8 byte and returns a u8 byte. ```APIDOC ## Function: high ### Description Performs an operation on a single byte and returns a byte. ### Signature `pub fn high(byte: u8) -> u8` ### Parameters - **byte** (u8) - The input byte to process. ### Returns - **u8** - The resulting byte. ``` -------------------------------- ### Serializer::serialize_u32 Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Serializer.html?search=u32+-%3E+bool Serializes a u32 value. ```APIDOC ## fn serialize_u32(self, v: u32) -> Result ### Description Serializes a `u32` value into the output stream. ### Parameters - **v** (u32) - The unsigned 32-bit integer value to serialize. ``` -------------------------------- ### Deserializer Methods Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Deserializer.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E A collection of methods for hinting expected data types and structures during deserialization. ```APIDOC ## deserialize_newtype_struct Hint that the Deserialize type is expecting a newtype struct with a particular name. ## deserialize_seq Hint that the Deserialize type is expecting a sequence of values. ## deserialize_tuple Hint that the Deserialize type is expecting a sequence of values and knows how many values there are without looking at the serialized data. ## deserialize_tuple_struct Hint that the Deserialize type is expecting a tuple struct with a particular name and number of fields. ## deserialize_map Hint that the Deserialize type is expecting a map of key-value pairs. ## deserialize_struct Hint that the Deserialize type is expecting a struct with a particular name and fields. ## deserialize_enum Hint that the Deserialize type is expecting an enum value with a particular name and possible variants. ## deserialize_identifier Hint that the Deserialize type is expecting the name of a struct field or the discriminant of an enum variant. ## deserialize_ignored_any Hint that the Deserialize type needs to deserialize a value whose type doesn’t matter because it is ignored. ## is_human_readable Determine whether Deserialize implementations should expect to deserialize their human-readable form. ``` -------------------------------- ### pub fn from_reader(reader: R) -> Result> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.from_reader.html?search= Decodes a value from a reader. ```APIDOC ## Function: from_reader ### Description Decodes a value from a reader. ### Signature `pub fn from_reader(reader: R) -> Result>` ### Constraints - **T**: Must implement `DeserializeOwned` - **R**: Must implement `BufRead` ### Returns - **Result>**: Returns the decoded value or a decoding error. ``` -------------------------------- ### pub fn from_reader(reader: R) -> Result> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.from_reader.html Decodes a value from a reader. ```APIDOC ## Function: from_reader ### Description Decodes a value from a reader. ### Signature `pub fn from_reader(reader: R) -> Result>` ### Constraints - **T**: Must implement `DeserializeOwned` - **R**: Must implement `BufRead` ### Returns - **Result>**: Returns the decoded value or a `DecodeError` if the operation fails. ``` -------------------------------- ### fn encode(&self, writer: &mut W) -> Result<(), Error> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/types/struct.Undefined.html?search=std%3A%3Avec Encodes the Undefined type into the provided writer using CBOR encoding. ```APIDOC ## fn encode(&self, writer: &mut W) -> Result<(), Error> ### Description Writes the Undefined type to the provided writer by performing CBOR encoding. ### Parameters - **writer** (&mut W) - Required - A mutable reference to a writer that implements the Write trait. ### Returns - **Result<(), Error>** - Returns Ok(()) on success, or an Error if the encoding fails. ``` -------------------------------- ### BufWriter::buffer Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/utils/struct.BufWriter.html?search=std%3A%3Avec Returns a reference to the underlying byte buffer. ```APIDOC ## pub fn buffer(&self) -> &[u8] ### Description Returns a reference to the underlying data currently held in the buffer. ``` -------------------------------- ### BufWriter::buffer Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/utils/struct.BufWriter.html?search=u32+-%3E+bool Returns a reference to the underlying byte buffer. ```APIDOC ### pub fn buffer(&self) -> &[u8] Returns a reference to the underlying data. ``` -------------------------------- ### pub fn to_writer(writer: W, value: &T) -> Result<(), EncodeError> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.to_writer.html Serializes a value to a writer. This function is part of the cbor4ii::serde module and requires the writer to implement the Write trait and the value to implement the Serialize trait. ```APIDOC ## Function: to_writer ### Description Serializes a value to a writer using CBOR encoding. ### Signature `pub fn to_writer(writer: W, value: &T) -> Result<(), EncodeError>` ### Constraints - **W**: Must implement `std::io::Write`. - **T**: Must implement `serde::Serialize`. ### Returns - **Result<(), EncodeError>**: Returns `Ok(())` on success, or an `EncodeError` if serialization fails. ``` -------------------------------- ### Serialization Methods Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Serializer.html?search=std%3A%3Avec Methods for serializing complex data structures and primitive types. ```APIDOC ## serialize_seq(len: Option) Begin to serialize a variably sized sequence. Must be followed by calls to `serialize_element` and `end`. ## serialize_tuple(len: usize) Begin to serialize a statically sized sequence. Must be followed by calls to `serialize_element` and `end`. ## serialize_tuple_struct(name: &'static str, len: usize) Begin to serialize a tuple struct. Must be followed by calls to `serialize_field` and `end`. ## serialize_tuple_variant(name: &'static str, variant_index: u32, variant: &'static str, len: usize) Begin to serialize a tuple variant. Must be followed by calls to `serialize_field` and `end`. ## serialize_map(len: Option) Begin to serialize a map. Must be followed by calls to `serialize_key`, `serialize_value`, and `end`. ## serialize_struct(name: &'static str, len: usize) Begin to serialize a struct. Must be followed by calls to `serialize_field` and `end`. ## serialize_struct_variant(name: &'static str, variant_index: u32, variant: &'static str, len: usize) Begin to serialize a struct variant. Must be followed by calls to `serialize_field` and `end`. ## serialize_i128(v: i128) Serialize an `i128` value. ## serialize_u128(v: u128) Serialize a `u128` value. ## collect_str(value: &T) where T: Display Serialize a string produced by an implementation of `Display`. ## is_human_readable() Determine whether `Serialize` implementations should serialize in human-readable form. ## collect_seq(iter: I) where I: IntoIterator Collect an iterator as a sequence. ## collect_map(iter: I) where I: IntoIterator Collect an iterator as a map. ``` -------------------------------- ### pub fn if_major(byte: u8) -> u8 Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/dec/fn.if_major.html Determines the object type from the given byte. ```APIDOC ## if_major ### Description Determines the object type from the given byte. ### Signature `pub fn if_major(byte: u8) -> u8` ### Parameters - **byte** (u8) - The input byte to evaluate. ### Returns - **u8** - The major type identifier derived from the input byte. ``` -------------------------------- ### serialize_struct_variant Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Serializer.html?search=u32+-%3E+bool Begin to serialize a struct variant. ```APIDOC ## fn serialize_struct_variant(self, _name: &'static str, _variant_index: u32, variant: &'static str, len: usize) -> Result ### Description Begin to serialize a struct variant like `E::S` in `enum E { S { r: u8, g: u8, b: u8 } }`. This call must be followed by zero or more calls to `serialize_field`, then a call to `end`. ``` -------------------------------- ### IoWriter::into_inner Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/utils/struct.IoWriter.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Consumes the IoWriter and returns the inner writer. ```APIDOC ## pub fn into_inner(self) -> W ### Description Consumes the IoWriter instance and returns the underlying writer that was wrapped. ``` -------------------------------- ### IoWriter::into_inner Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/utils/struct.IoWriter.html?search=std%3A%3Avec Consumes the IoWriter and returns the inner writer. ```APIDOC ## pub fn into_inner(self) -> W ### Description Consumes the IoWriter and returns the inner writer that was wrapped. ``` -------------------------------- ### pub fn is_break<'de, R: Read<'de>>(reader: &mut R) -> Result> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/dec/fn.is_break.html Checks if the next byte in the reader is a CBOR break stop code. ```APIDOC ## Function: is_break ### Description Checks if the current position in the provided CBOR reader represents a break stop code. This is typically used when decoding indefinite-length CBOR structures. ### Signature `pub fn is_break<'de, R: Read<'de>>(reader: &mut R) -> Result>` ### Parameters - **reader** (&mut R) - Required - A mutable reference to a type implementing the `Read` trait. ### Returns - **Result>** - Returns `Ok(true)` if a break code is encountered, `Ok(false)` otherwise, or an `Error` if the read operation fails. ``` -------------------------------- ### pub fn to_vec(buf: Vec, value: &T) -> Result, EncodeError> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.to_vec.html?search=u32+-%3E+bool Serializes a value to a writer. This function takes an existing buffer and a reference to a serializable value, returning the resulting byte vector or an encoding error. ```APIDOC ## Function: to_vec ### Description Serializes a value to a writer. This function is part of the cbor4ii::serde module. ### Signature `pub fn to_vec(buf: Vec, value: &T) -> Result, EncodeError> where T: Serialize` ### Parameters - **buf** (Vec) - The initial buffer to use for serialization. - **value** (&T) - The value to be serialized, which must implement the Serialize trait. ### Returns - **Result, EncodeError>** - Returns the serialized byte vector on success, or an EncodeError if serialization fails. ``` -------------------------------- ### pub fn to_vec(buf: Vec, value: &T) -> Result, EncodeError> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.to_vec.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Serializes a value to a writer. This function takes an existing buffer and a reference to a serializable value, returning the resulting byte vector or an encoding error. ```APIDOC ## Function: to_vec ### Description Serializes a value to a writer. This function is part of the cbor4ii::serde module and is used to convert a serializable type into a CBOR-encoded byte vector. ### Signature `pub fn to_vec(buf: Vec, value: &T) -> Result, EncodeError> where T: Serialize` ### Parameters - **buf** (Vec) - The initial buffer to use for serialization. - **value** (&T) - A reference to the value to be serialized. Must implement the Serialize trait. ### Returns - **Result, EncodeError>** - Returns the serialized byte vector on success, or an EncodeError if serialization fails. ``` -------------------------------- ### as_bytes Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/struct.BoxedRawValue.html?search= Returns the underlying bytes of the BoxedRawValue. ```APIDOC ### pub fn as_bytes(&self) -> &[u8] Returns the raw bytes contained within the BoxedRawValue. ``` -------------------------------- ### as_bytes Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/struct.RawValue.html Returns the underlying bytes of the RawValue. ```APIDOC ## pub fn as_bytes(&self) -> &'de [u8] ### Description Returns the raw bytes of the CBOR-encoded value. ### Returns - **&'de [u8]** - A reference to the byte slice containing the encoded data. ``` -------------------------------- ### serialize_tuple_variant Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Serializer.html?search=u32+-%3E+bool Begin to serialize a tuple variant. ```APIDOC ## fn serialize_tuple_variant(self, _name: &'static str, _variant_index: u32, variant: &'static str, len: usize) -> Result ### Description Begin to serialize a tuple variant like `E::T` in `enum E { T(u8, u8) }`. This call must be followed by zero or more calls to `serialize_field`, then a call to `end`. ``` -------------------------------- ### pub fn low(byte: u8) -> u8 Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/dec/fn.low.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E The low function accepts a u8 byte and returns a u8 value. ```APIDOC ## Function: low ### Description Extracts the lower portion of a byte. This function is part of the `cbor4ii::core::dec` module. ### Signature `pub fn low(byte: u8) -> u8` ### Parameters - **byte** (u8) - The input byte to process. ### Returns - **u8** - The resulting byte. ``` -------------------------------- ### as_bytes Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/struct.BoxedRawValue.html?search=std%3A%3Avec Returns the underlying byte representation of the BoxedRawValue. ```APIDOC ## pub fn as_bytes(&self) -> &[u8] ### Description Returns the raw byte slice representation of the boxed CBOR value. ### Returns - **&[u8]** - A reference to the byte slice containing the encoded data. ``` -------------------------------- ### to_writer(writer: W, value: &T) -> Result<(), EncodeError> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.to_writer.html?search= Serializes a value to a writer. ```APIDOC ## Function: to_writer ### Description Serializes a value to a writer. ### Signature `pub fn to_writer(writer: W, value: &T) -> Result<(), EncodeError>` ### Constraints - **W**: Must implement `Write` - **T**: Must implement `Serialize` ### Parameters - **writer** (W) - The writer to which the value will be serialized. - **value** (&T) - The value to be serialized. ### Returns - **Result<(), EncodeError>** - Returns `Ok(())` on success, or an `EncodeError` if serialization fails. ``` -------------------------------- ### to_writer(writer: W, value: &T) -> Result<(), EncodeError> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.to_writer.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Serializes a value to a writer. ```APIDOC ## Function: to_writer ### Description Serializes a value to a writer. ### Signature `pub fn to_writer(writer: W, value: &T) -> Result<(), EncodeError>` ### Constraints - **W**: Must implement `Write` - **T**: Must implement `Serialize` ### Returns - **Result<(), EncodeError>**: Returns `Ok(())` on success, or an `EncodeError` if serialization fails. ``` -------------------------------- ### pub fn to_vec(buf: Vec, value: &T) -> Result, EncodeError> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.to_vec.html Serializes a value to a writer. This function takes an existing buffer and a reference to a serializable value, returning the encoded byte vector or an error. ```APIDOC ## Function: to_vec ### Description Serializes a value to a writer. This function encodes the provided value into CBOR format and appends it to the provided buffer. ### Signature `pub fn to_vec(buf: Vec, value: &T) -> Result, EncodeError> where T: Serialize` ### Parameters - **buf** (Vec) - The initial buffer to serialize into. - **value** (&T) - The value to be serialized, which must implement the `Serialize` trait. ### Returns - **Result, EncodeError>** - Returns the resulting byte vector on success, or an `EncodeError` if serialization fails. ``` -------------------------------- ### serialize_i128 / serialize_u128 Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Serializer.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Serializes 128-bit integer values. ```APIDOC ## fn serialize_i128(self, v: i128) -> Result ## fn serialize_u128(self, v: u128) -> Result ### Description Serializes an `i128` or `u128` value respectively. ``` -------------------------------- ### encode Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/struct.RawValue.html Encodes the RawValue to a writer. ```APIDOC ## pub fn encode(&self, writer: &mut W) -> Result<(), Error> ### Description Writes the RawValue to the provided writer using CBOR encoding. ### Parameters - **writer** (W: Write) - The destination writer. ### Returns - **Result<(), Error>** - Returns Ok(()) on success or an error if encoding fails. ``` -------------------------------- ### Array Struct Definition Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/types/struct.Array.html?search=u32+-%3E+bool The basic definition of the Array struct. ```rust pub struct Array(pub T); ``` -------------------------------- ### Function signature for from_slice Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.from_slice.html The function signature for decoding a value from a byte slice. ```rust pub fn from_slice<'a, T>(buf: &'a [u8]) -> Result> where T: Deserialize<'a>, ``` -------------------------------- ### to_writer Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.to_writer.html?search=std%3A%3Avec Serializes a value to a writer. ```APIDOC ## Function: to_writer ### Description Serializes a value to a writer. ### Signature `pub fn to_writer(writer: W, value: &T) -> Result<(), EncodeError>` ### Parameters - **writer** (W: Write) - The writer to which the value will be serialized. - **value** (&T) - The value to be serialized, which must implement the Serialize trait. ### Returns - **Result<(), EncodeError>** - Returns Ok(()) on success, or an EncodeError if serialization fails. ``` -------------------------------- ### to_writer Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/index.html?search= Serializes a value to a writer. ```APIDOC ## to_writer ### Description Serializes a value to a writer. ### Signature `pub fn to_writer(writer: W, value: &T) -> Result<(), EncodeError> where W: Write, T: Serialize` ``` -------------------------------- ### from_slice Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/index.html?search= Decodes a value from a bytes. ```APIDOC ## from_slice ### Description Decodes a value from a bytes. ### Signature `pub fn from_slice<'a, T>(slice: &'a [u8]) -> Result where T: Deserialize<'a>` ``` -------------------------------- ### serde::to_vec Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/all.html Serializes a value into a CBOR-encoded byte vector. ```APIDOC ## serde::to_vec ### Description Serializes a value into a CBOR-encoded byte vector. ### Signature `pub fn to_vec(value: &T) -> Result, EncodeError> where T: Serialize` ``` -------------------------------- ### serde::from_reader Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/all.html Deserializes a CBOR-encoded value from an IO reader. ```APIDOC ## serde::from_reader ### Description Deserializes a CBOR-encoded value from a reader implementing the Read trait. ### Signature `pub fn from_reader(reader: R) -> Result where T: DeserializeOwned, R: Read` ``` -------------------------------- ### Deserializer::into_inner Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Deserializer.html Consumes the Deserializer and returns the underlying reader. ```APIDOC ## pub fn into_inner(self) -> R ### Description Consumes the Deserializer and returns the reader that was used to create it. ``` -------------------------------- ### Deserializer::into_inner Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Deserializer.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Consumes the Deserializer and returns the underlying reader. ```APIDOC ## pub fn into_inner(self) -> R ### Description Consumes the `Deserializer` and returns the underlying reader that was used for deserialization. ``` -------------------------------- ### BufWriter::into_inner Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/utils/struct.BufWriter.html?search=u32+-%3E+bool Consumes the BufWriter and returns the underlying vector. ```APIDOC ### pub fn into_inner(self) -> Vec Returns the underlying vector. ``` -------------------------------- ### pub fn is_break<'de, R: Read<'de>>(reader: &mut R) -> Result> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/dec/fn.is_break.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Checks if the next item in the CBOR stream is a break token. ```APIDOC ## Function: is_break ### Description Checks if the current position in the provided CBOR reader corresponds to a break token. This is typically used when decoding indefinite-length CBOR structures. ### Signature `pub fn is_break<'de, R: Read<'de>>(reader: &mut R) -> Result>` ### Parameters - **reader** (&mut R) - A mutable reference to a type implementing the `Read` trait, representing the CBOR input stream. ### Returns - **Result>** - Returns `Ok(true)` if a break token is encountered, `Ok(false)` if it is not, or an `Error` if the read operation fails. ``` -------------------------------- ### Serializer::into_inner Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Serializer.html?search=std%3A%3Avec Consumes the serializer and returns the underlying writer. ```APIDOC ### pub fn into_inner(self) -> W Consumes the `Serializer` and returns the underlying writer instance. ``` -------------------------------- ### from_value Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/struct.BoxedRawValue.html?search= Creates a new BoxedRawValue from a given Value. ```APIDOC ### pub fn from_value(value: &Value) -> Result> Creates a new BoxedRawValue instance by encoding the provided Value. ``` -------------------------------- ### Bytes::bounded Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/types/struct.Bytes.html?search=std%3A%3Avec Encodes a byte string with a length prefix into the provided writer. ```APIDOC ## pub fn bounded(len: usize, writer: &mut W) -> Result<(), Error> ### Description Encodes the type with the length prefix. ### Parameters - **len** (usize) - The length of the byte string. - **writer** (&mut W) - The writer to encode into. ``` -------------------------------- ### Define SIMPLE constant Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/major/constant.SIMPLE.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E The constant is defined as a u8 with a value of 7. ```rust pub const SIMPLE: u8 = 7; ``` -------------------------------- ### collect_str Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Serializer.html?search=u32+-%3E+bool Serialize a string produced by an implementation of Display. ```APIDOC ## fn collect_str(self, value: &T) -> Result where T: Display + ?Sized ### Description Serialize a string produced by an implementation of `Display`. ``` -------------------------------- ### from_slice Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.from_slice.html?search=std%3A%3Avec Decodes a value from a byte slice. ```APIDOC ## Function: from_slice ### Description Decodes a value from a byte slice. ### Signature `pub fn from_slice<'a, T>(buf: &'a [u8]) -> Result> where T: Deserialize<'a>` ### Parameters - **buf** (&[u8]) - The byte slice containing the CBOR-encoded data. ### Returns - **Result>** - Returns the deserialized value of type T, or a DecodeError if the operation fails. ``` -------------------------------- ### from_slice Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/index.html Decodes a value from a bytes slice. ```APIDOC ## from_slice ### Description Decodes a value from a bytes slice. ### Signature `pub fn from_slice<'a, T>(slice: &'a [u8]) -> Result where T: Deserialize<'a>` ``` -------------------------------- ### from_value Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/struct.BoxedRawValue.html?search=std%3A%3Avec Creates a new BoxedRawValue from an existing Value. ```APIDOC ## pub fn from_value(value: &Value) -> Result> ### Description Converts a given Value into a BoxedRawValue. ### Parameters - **value** (&Value) - The source value to convert. ### Returns - **Result>** - Returns the new BoxedRawValue on success, or an Error if the conversion fails. ``` -------------------------------- ### fn decode>(reader: &mut R) -> Result> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/dec/trait.Decode.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E The required method for the Decode trait, used to deserialize a type from a reader. ```APIDOC ## fn decode>(reader: &mut R) -> Result> ### Description Decodes a value of the implementing type from the provided reader. ### Parameters - **reader** (&mut R) - Required - A mutable reference to a reader that implements the Read trait. ### Returns - **Result>** - Returns the decoded instance of the type on success, or an error if decoding fails. ``` -------------------------------- ### BufWriter::into_inner Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/utils/struct.BufWriter.html?search=std%3A%3Avec Consumes the writer and returns the underlying vector. ```APIDOC ## pub fn into_inner(self) -> Vec ### Description Consumes the BufWriter instance and returns the underlying Vec. ``` -------------------------------- ### Bytes::end Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/types/struct.Bytes.html?search=std%3A%3Avec Encodes the indefinite size end marker for a byte string. ```APIDOC ## pub fn end(writer: &mut W) -> Result<(), Error> ### Description Encode the indefinite size end marker. ### Parameters - **writer** (&mut W) - The writer to encode into. ``` -------------------------------- ### as_bytes Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/struct.RawValue.html?search= Returns the underlying byte slice of the CBOR-encoded value. ```APIDOC ## pub fn as_bytes(&self) -> &'de [u8] ### Description Returns the underlying byte slice of the CBOR-encoded value. ### Returns - **&'de [u8]** - The raw bytes of the CBOR value. ``` -------------------------------- ### as_bytes Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/struct.RawValue.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Returns the underlying byte slice of the CBOR-encoded value. ```APIDOC ## pub fn as_bytes(&self) -> &'de [u8] ### Description Returns the underlying byte slice of the CBOR-encoded value. ### Returns - **&'de [u8]** - A reference to the byte slice containing the raw CBOR data. ``` -------------------------------- ### pub fn from_slice<'a, T>(buf: &'a [u8]) -> Result> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.from_slice.html Decodes a value from a byte slice. ```APIDOC ## Function: from_slice ### Description Decodes a value from a byte slice. ### Signature `pub fn from_slice<'a, T>(buf: &'a [u8]) -> Result> where T: Deserialize<'a>` ### Parameters - **buf** (&[u8]) - Required - The byte slice containing the CBOR-encoded data. ### Returns - **Result>** - Returns the deserialized value of type T, or a DecodeError if deserialization fails. ``` -------------------------------- ### pub fn from_slice<'a, T>(buf: &'a [u8]) -> Result> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.from_slice.html?search=u32+-%3E+bool Decodes a value from a byte slice. ```APIDOC ## Function: from_slice ### Description Decodes a value from a byte slice. ### Signature `pub fn from_slice<'a, T>(buf: &'a [u8]) -> Result> where T: Deserialize<'a>` ### Parameters - **buf** (&'a [u8]) - The byte slice containing the encoded CBOR data. ### Returns - **Result>** - Returns the deserialized value of type T on success, or a DecodeError on failure. ``` -------------------------------- ### pub fn from_slice<'a, T>(buf: &'a [u8]) -> Result> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.from_slice.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Decodes a value from a byte slice. ```APIDOC ## Function: from_slice ### Description Decodes a value from a byte slice. ### Signature `pub fn from_slice<'a, T>(buf: &'a [u8]) -> Result>` ### Parameters - **buf** (&'a [u8]) - The byte slice to decode from. ### Returns - **Result>** - Returns the decoded value of type T, or a DecodeError if decoding fails. ``` -------------------------------- ### Map::end Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/types/struct.Map.html Encodes the end marker for an indefinite size map. ```APIDOC ## pub fn end(writer: &mut W) -> Result<(), Error> ### Description Encodes the indefinite size end marker for a CBOR map to the provided writer. ### Parameters - **writer** (&mut W) - The writer to which the encoded data is written. ``` -------------------------------- ### pub fn high(byte: u8) -> u8 Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/dec/fn.high.html This function takes a single byte as input and returns a byte. It is part of the core decoding functionality of the cbor4ii library. ```APIDOC ## Function: high ### Description Extracts the high bits from a given byte. This is a low-level utility function used within the CBOR decoding process. ### Signature `pub fn high(byte: u8) -> u8` ### Parameters - **byte** (u8) - The input byte to process. ### Returns - **u8** - The resulting byte after the high bit operation. ``` -------------------------------- ### deserialize_struct Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Deserializer.html Hints that the Deserialize type is expecting a struct with a particular name and fields. ```APIDOC fn deserialize_struct(self, _name: &'static str, _fields: &'static [&'static str], visitor: V) -> Result where V: Visitor<'de> ``` -------------------------------- ### Function signature of from_reader Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.from_reader.html The function requires a type that implements DeserializeOwned and a reader that implements BufRead. ```rust pub fn from_reader(reader: R) -> Result> where T: DeserializeOwned, R: BufRead, ``` -------------------------------- ### serialize_i128 Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Serializer.html?search=u32+-%3E+bool Serialize an i128 value. ```APIDOC ## fn serialize_i128(self, v: i128) -> Result ### Description Serialize an `i128` value. ``` -------------------------------- ### Define Bytes struct Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/types/struct.Bytes.html The basic structure definition for the Bytes type. ```rust pub struct Bytes(pub T); ``` -------------------------------- ### RawValue::as_bytes Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/struct.RawValue.html?search=std%3A%3Avec Returns the underlying bytes of the RawValue. ```APIDOC ## pub fn as_bytes(&self) -> &'de [u8] ### Description Returns the underlying bytes of the RawValue as a byte slice. ### Signature `pub fn as_bytes(&self) -> &'de [u8]` ``` -------------------------------- ### UncheckedStr::end Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/types/struct.UncheckedStr.html?search=std%3A%3Avec Encodes the indefinite size end marker. ```APIDOC ## pub fn end(writer: &mut W) -> Result<(), Error> ### Description Encodes the indefinite size end marker into the provided writer. ### Parameters - **writer** (&mut W) - The writer to encode the data into. ``` -------------------------------- ### Bytes::bounded Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/types/struct.Bytes.html?search= Encodes the type with a length prefix into the provided writer. ```APIDOC ## pub fn bounded(len: usize, writer: &mut W) -> Result<(), Error> ### Description Encodes the type with a length prefix into the provided writer. ### Parameters - **len** (usize) - The length of the byte sequence. - **writer** (&mut W) - The writer to encode into. ``` -------------------------------- ### low function signature Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/dec/fn.low.html?search= The function signature for the low utility in the cbor4ii crate. ```rust pub fn low(byte: u8) -> u8 ``` -------------------------------- ### Serialize a value to a writer Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.to_writer.html?search= The function signature for serializing a value to a writer that implements the Write trait. ```rust pub fn to_writer(writer: W, value: &T) -> Result<(), EncodeError> where W: Write, T: Serialize, ``` -------------------------------- ### is_human_readable Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Deserializer.html Determine whether Deserialize implementations should expect to deserialize their human-readable form. ```APIDOC fn is_human_readable(&self) -> bool ``` -------------------------------- ### IoReader Struct Definition Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/utils/struct.IoReader.html?search=std%3A%3Avec The definition of the IoReader struct. ```rust pub struct IoReader { /* private fields */ } ``` -------------------------------- ### Map::bounded Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/types/struct.Map.html Encodes a CBOR map with a specified length prefix. ```APIDOC ## pub fn bounded(len: usize, writer: &mut W) -> Result<(), Error> ### Description Encodes the CBOR map type with a length prefix to the provided writer. ### Parameters - **len** (usize) - The number of elements in the map. - **writer** (&mut W) - The writer to which the encoded data is written. ``` -------------------------------- ### Read Trait Definition Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/dec/trait.Read.html?search= The core trait definition for reading data, including required methods for filling buffers and advancing the reader. ```rust pub trait Read<'de> { type Error: Error + 'static; // Required methods fn fill<'short>( &'short mut self, want: usize, ) -> Result, Self::Error>; fn advance(&mut self, n: usize); // Provided methods fn step_in(&mut self) -> bool { ... } fn step_out(&mut self) { ... } } ``` -------------------------------- ### Define Undefined struct Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/types/struct.Undefined.html?search= The definition of the Undefined unit struct. ```rust pub struct Undefined; ``` -------------------------------- ### from_reader Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.from_reader.html?search=std%3A%3Avec Decodes a value from a reader. ```APIDOC ## Function: from_reader ### Description Decodes a value from a reader. ### Signature `pub fn from_reader(reader: R) -> Result>` ### Constraints - `T: DeserializeOwned` - `R: BufRead` ### Parameters - **reader** (R) - The reader to decode from. ``` -------------------------------- ### Define Tag struct Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/types/struct.Tag.html The definition of the Tag struct, which holds a u64 tag and a generic value. ```rust pub struct Tag(pub u64, pub T); ``` -------------------------------- ### deserialize_seq Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/struct.Deserializer.html Hints that the Deserialize type is expecting a sequence of values. ```APIDOC fn deserialize_seq(self, visitor: V) -> Result where V: Visitor<'de> ``` -------------------------------- ### RawValue::encode Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/struct.RawValue.html?search=std%3A%3Avec Encodes the RawValue to a writer. ```APIDOC ## fn encode(&self, writer: &mut W) -> Result<(), Error> ### Description Writes the RawValue to the provided writer using CBOR encoding. ### Signature `fn encode(&self, writer: &mut W) -> Result<(), Error>` ``` -------------------------------- ### Encode::encode Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/enc/trait.Encode.html?search=std%3A%3Avec Encodes the implementing type into CBOR format and writes it to the provided writer. ```APIDOC ## fn encode(&self, writer: &mut W) -> Result<(), Error> ### Description Writes the current type to the provided writer using CBOR encoding. ### Parameters - **writer** (&mut W) - The destination writer that implements the Write trait. ### Returns - **Result<(), Error>** - Returns Ok(()) on success, or an Error if the encoding or writing process fails. ``` -------------------------------- ### to_vec(buf: Vec, value: &T) -> Result, EncodeError> Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/fn.to_vec.html?search= Serializes a value to a writer, returning a Result containing the encoded byte vector or an EncodeError. ```APIDOC ## Function: to_vec ### Description Serializes a value to a writer. This function takes an existing buffer and a reference to a serializable value, returning the encoded byte vector. ### Signature `pub fn to_vec(buf: Vec, value: &T) -> Result, EncodeError> where T: Serialize` ### Parameters - **buf** (Vec) - The initial buffer to use for serialization. - **value** (&T) - The value to be serialized, which must implement the Serialize trait. ### Returns - **Result, EncodeError>** - Returns the serialized byte vector on success, or an EncodeError on failure. ``` -------------------------------- ### F64 Constant Definition Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/marker/constant.F64.html The constant value used to identify 64-bit floats in the CBOR encoding. ```rust pub const F64: u8 = 0xfb; ``` -------------------------------- ### to_vec Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/serde/index.html?search= Serializes a value to a vector. ```APIDOC ## to_vec ### Description Serializes a value to a vector. ### Signature `pub fn to_vec(value: &T) -> Result, EncodeError> where T: Serialize` ``` -------------------------------- ### Define TRUE constant Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/marker/constant.TRUE.html Represents the CBOR byte value for true. ```rust pub const TRUE: u8 = 0xf5; ``` -------------------------------- ### BoxedRawValue::as_bytes Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/struct.BoxedRawValue.html Returns the underlying byte representation of the boxed raw value. ```APIDOC ## pub fn as_bytes(&self) -> &[u8] ### Description Returns the underlying byte slice of the CBOR-encoded data contained within the BoxedRawValue. ### Parameters - **&self** - The instance of BoxedRawValue. ### Returns - **&[u8]** - A reference to the raw byte slice. ``` -------------------------------- ### Define Negative struct Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/types/struct.Negative.html?search= The basic structure definition for the generic Negative type. ```rust pub struct Negative(pub T); ``` -------------------------------- ### Define STRING constant Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/major/constant.STRING.html Represents the CBOR major type value for string data types. ```rust pub const STRING: u8 = 3; ``` -------------------------------- ### serde::from_slice Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/all.html Deserializes a CBOR-encoded value from a byte slice. ```APIDOC ## serde::from_slice ### Description Deserializes a CBOR-encoded value from a byte slice. ### Signature `pub fn from_slice<'a, T>(slice: &'a [u8]) -> Result where T: Deserialize<'a>` ``` -------------------------------- ### Encode Implementation for Null Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/types/struct.Null.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E The encode method implementation for the Null struct, allowing it to be written to a CBOR writer. ```rust fn encode(&self, writer: &mut W) -> Result<(), Error> ``` -------------------------------- ### Null struct definition Source: https://docs.rs/cbor4ii/1.2.2/cbor4ii/core/types/struct.Null.html The definition of the Null unit struct. ```rust pub struct Null; ```