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: types.rs
    path of file: ./repos/cxx-qt/examples/qml_features/rust/src
    
    the code of the file until where you have to start completion: // SPDX-FileCopyrightText: 2022 Klar√§lvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
// SPDX-FileContributor: Andrew Hayzen <andrew.hayzen@kdab.com>
//
// SPDX-License-Identifier: MIT OR Apache-2.0

//! This example shows how a custom type can be used with a QVariant

/// A struct which is a custom type we want to use with a QVariant
// ANCHOR: book_macro_code
#[repr(C)]
pub struct CustomStruct {
    value: i32,
}

unsafe impl cxx::ExternType for CustomStruct {
    
    pub fn load_from_variant(self: Pin<&mut Self>, variant: &QVariant) {
        if let Some(boolean) = variant.value::<bool>() {
            self.set_boolean(boolean);
        } else if let Some(point) = variant.value::<QPointF>() {
            self.set_point(point);
        } else if let Some(url) = variant.value::<QUrl>() {
            self.set_url(url);
        } else if let Some(custom) = variant.value::<CustomStruct>() {
            self.set_custom_value(custom.value);
        } else {
            println!("Unknown QVariant type to load from");
        }
    }