You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: pairs.rs
    path of file: ./repos/bottlerocket/sources/api/datastore/src/serialization
    
    the code of the file until where you have to start completion: //! The goal of this module is to be able to turn serializable structures, primarily the API model,
//! into a form that can be easily written to our data store, key by key, since we will often
//! receive arbitrary subsets of the valid keys.  We use serde to help walk through the structure,
//! and use the Serializer's associated types to keep track of where we are in the tree of nested
//! structures.

//! The serialization pattern below could be used for other structures as well, but we're starting
//! out by orienting it toward the API model.  As such, data types are oriented around TOML/JSON
//! types, to be sure we support the various forms of input/output we care about.

use log::trace;
use serde::{ser, Serialize};
use snafu::{IntoError, NoneError as NoS
    
    fn serialize_struct(self, name: &'static str, _len: usize) -> Result<Self::SerializeStruct> {
        trace!("Serializing struct '{}' at prefix {:?}", name, self.prefix);
        // If we already have a prefix, use it - could be because we're in a nested struct, or the
        // user gave a prefix.  Otherwise, use the given name - this is a top-level struct.
        let prefix = match self.prefix {
            p @ Some(_) => p,
            None => {
                trace!("Had no prefix, starting with struct name: {}", name);
                let key = Key::from_segments(KeyType::Data, &[&name]).map_err(|e| {
                    error::InvalidKeySnafu {
                        msg: format!("struct '{}' not valid as Key: {}", name, e),
                    }
                    .into_error(NoSource)
                })?;
                Some(key)
            }
        };
        Ok(Serializer::new(self.output, prefix))
    }