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: sankey.rs
    path of file: ./repos/plotly/plotly/src/traces
    
    the code of the file until where you have to start completion: //! Sankey trace

use plotly_derive::FieldSetter;
use serde::Serialize;

use crate::{
    color::{Color, ColorArray},
    common::{Dim, Domain, Font, HoverInfo, Label, LegendGroupTitle, Orientation, PlotType},
    Trace,
};

#[derive(Serialize, Clone)]
#[serde(rename_all = "lowercase")]
pub enum Arrangement {
    Snap,
    Perpendicular,
    Freeform,
    Fixed,
}

#[serde_with::skip_serializing_none]
#[derive(Serialize, Clone, Default)]
pub struct Line {
    color: Option<Dim<Box<dyn Color>>>,
    width: Option<f64>,
}

impl Line {
    pub fn new() -> Self {
        Default::default()
    }

    pub fn color<C: Color>(mut self, color: C) -> Self {
        self.color = Some(Dim::Scalar(Box::new(color)));
        self
    }

    pub fn color_array<C: Color>(mut self, colors: Vec<C>) -> Self {
        self.color = Some(Dim::Vector(ColorArray(colors).into()));
        self
    }

    pub fn width(mut self, width: f64) -> Self {
        self.width = Some(width);
        self
    }
    
    fn test_serialize_basic_sankey_trace() {
        // Mimic the plot here, minus the layout:
        // https://plotly.com/javascript/sankey-diagram/#basic-sankey-diagram
        let trace = Sankey::new()
            .orientation(Orientation::Horizontal)
            .node(
                Node::new()
                    .pad(15)
                    .thickness(30)
                    .line(Line::new().color(NamedColor::Black).width(0.5))
                    .label(vec!["A1", "A2", "B1", "B2", "C1", "C2"])
                    .color_array(vec![
                        NamedColor::Blue,
                        NamedColor::Blue,
                        NamedColor::Blue,
                        NamedColor::Blue,
                        NamedColor::Blue,
                        NamedColor::Blue,
                    ]),
            )
            .link(
                Link::new()
                    .value(vec![8, 4, 2, 8, 4, 2])
                    .source(vec![0, 1, 0, 2, 3, 3])
                    .target(vec![2, 3, 3, 4, 4, 5]),
            );

        let expected = json!({
            "link": {
                "source": [0, 1, 0, 2, 3, 3],
                "target": [2, 3, 3, 4, 4, 5],
                "value": [8, 4, 2, 8, 4, 2]
            },
            "orientation": "h",
            "type": "sankey",
            "node": {
                "color": ["blue", "blue", "blue", "blue", "blue", "blue"],
                "label": ["A1", "A2", "B1", "B2", "C1", "C2"],
                "line": {
                    "color": "black",
                    "width": 0.5
                },
                "pad": 15,
                "thickness": 30
            }
        });

        assert_eq!(to_value(trace).unwrap(), expected);
    }