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: plugin_custom_value.rs
    path of file: ./repos/nushell/crates/nu-plugin/src/protocol
    
    the code of the file until where you have to start completion: use std::sync::Arc;

use nu_protocol::{CustomValue, ShellError, Span, Spanned, Value};
use serde::{Deserialize, Serialize};

use crate::plugin::PluginSource;

#[cfg(test)]
mod tests;

/// An opaque container for a custom value that is handled fully by a plugin
///
/// This is the only type of custom value that is allowed to cross the plugin serialization
/// boundary.
///
/// [`EngineInterface`](crate::interface::EngineInterface) is responsible for ensuring
/// that local plugin custom values are converted to and from [`PluginCustomData`] on the boundary.
///
/// [`PluginInterface`](crate::interface::PluginInterface) is responsible for adding the
/// appropriate [`PluginSource`](crate::plugin::PluginSource), ensuring that only
/// [`PluginCustomData`] is contained within any values sent, and that the `source` of any
/// values sent matches the plugin it is being sent to.
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct PluginCustomValue {
    /// The name of the custom value as defined by the plugin (`value_string()`)
    pub name: String,
    /// The bincoded representation of the custom value on the plugin side
    pub data: Vec<u8>,

 
    
    pub(crate) fn add_source(value: &mut Value, source: &Arc<PluginSource>) {
        let span = value.span();
        match value {
            // Set source on custom value
            Value::CustomValue { ref val, .. } => {
                if let Some(custom_value) = val.as_any().downcast_ref::<PluginCustomValue>() {
                    // Since there's no `as_mut_any()`, we have to copy the whole thing
                    let mut custom_value = custom_value.clone();
                    custom_value.source = Some(source.clone());
                    *value = Value::custom_value(Box::new(custom_value), span);
                }
            }
            // Any values that can contain other values need to be handled recursively
            Value::Range { ref mut val, .. } => {
                Self::add_source(&mut val.from, source);
                Self::add_source(&mut val.to, source);
                Self::add_source(&mut val.incr, source);
            }
            Value::Record { ref mut val, .. } => {
                for (_, rec_value) in val.iter_mut() {
                    Self::add_source(rec_value, source);
                }
            }
            Value::List { ref mut vals, .. } => {
                for list_value in vals.iter_mut() {
                    Self::add_source(list_value, source);
                }
            }
            Value::Closure { ref mut val, .. } => {
                for (_, captured_value) in val.captures.iter_mut() {
                    Self::add_source(captured_value, source);
                }
            }
            // All of these don't contain other values
            Value::Bool { .. }
            | Value::Int { .. }
            | Value::Float { .. }
            | Value::Filesize { .. }
            | Value::Duration { .. }
            | Value::Date { .. }
            | Value::String { .. }
            | Value::Glob { .. }
            | Value::Block { .. }
            | Value::Nothing { .. }
            | Value::Error { .. }
            | Value::Binary { .. }
            | Value::CellPath { .. } => (),
            // LazyRecord could generate other values, but we shouldn't be receiving it anyway
            //
            // It's better to handle this as a bug
            Value::LazyRecord { .. } => unimplemented!("add_source for LazyRecord"),
        }
    }