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: multipart.rs
    path of file: ./repos/poem/poem-openapi/tests
    
    the code of the file until where you have to start completion: use std::io::Write;

use poem::{Request, RequestBody};
use poem_openapi::{
    payload::{ParsePayload, Payload},
    registry::{MetaSchema, MetaSchemaRef},
    types::{
        multipart::{JsonField, Upload},
        Binary,
    },
    Enum, Multipart, Object,
};

fn create_multipart_payload(parts: &[(&str, Option<&str>, &[u8])]) -> Vec<u8> {
    let mut data = Vec::new();

    for part in parts {
        data.write_all(b"--X-BOUNDARY\r\n").unwrap();
        match part.1 {
            Some(filename) => data
                .write_all(
                    format!(
                        "Content-Disposition: form-data; name=\"{}\"; filename=\"{}\"\r\n\r\n",
                        part.0, filename
                    )
                    .as_bytes(),
                )
                .unwrap(),
            None => data
                .write_all(
                    fo
    
async fn validator() {
    #[derive(Multipart, Debug, Eq, PartialEq)]
    struct A {
        #[oai(validator(max_length = "10"))]
        name: String,
        #[oai(validator(maximum(value = "32")))]
        value: JsonField<i32>,
    }

    let data = create_multipart_payload(&[("name", None, b"abc"), ("value", None, b"20")]);
    let a = A::from_request(
        &Request::builder()
            .header("content-type", "multipart/form-data; boundary=X-BOUNDARY")
            .finish(),
        &mut RequestBody::new(data.into()),
    )
    .await
    .unwrap();
    assert_eq!(a.name, "abc".to_string());
    assert_eq!(a.value, JsonField(20));

    let data = create_multipart_payload(&[("name", None, b"abc"), ("value", None, b"40")]);
    let err = A::from_request(
        &Request::builder()
            .header("content-type", "multipart/form-data; boundary=X-BOUNDARY")
            .finish(),
        &mut RequestBody::new(data.into()),
    )
    .await
    .unwrap_err();

    assert_eq!(
        err.to_string(),
        "parse multipart error: field `value` verification failed. maximum(32, exclusive: false)"
    );
}