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: sri.rs
    path of file: ./repos/trunk/src/pipelines/rust
    
    the code of the file until where you have to start completion: use crate::config::CrossOrigin;
use crate::processing::integrity::{IntegrityType, OutputDigest};
use nipper::Selection;
use std::collections::BTreeMap;
use std::fmt::{Display, Formatter};
use std::future::Future;
use std::path::Path;

#[derive(Clone, Debug, PartialEq, Eq, Hash, Ord, PartialOrd)]
pub enum SriType {
    Preload,
    ModulePreload,
}

impl Display for SriType {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::R
    
    pub fn inject(&self, mut location: Selection, base: impl Display, cross_origin: CrossOrigin) {
        for ((r#type, name), SriEntry { digest, options }) in &self.integrities {
            if let Some(integrity) = digest.to_integrity_value() {
                let preload = format!(
                    r#"
<link rel="{type}" href="{base}{name}" crossorigin={cross_origin} integrity="{integrity}"{options}>"#,
                );
                location.append_html(preload);
            }
        }
    }