fn create_reference_line_string(
    rap: &ResourceAccessPoint,
    state: &State,
    data: &mut VerticalLineData,
    registry: &Handlebars,
) -> String {
    match (state, rap.is_mut()) {
        (State::FullPrivilege, true) => {
            data.line_class = String::from("solid");
            if rap.is_ref() {
                data.title += "; can read and write data; can point to another piece of data";
            } else {
                data.title += "; can read and write data";
            }
            registry.render("vertical_line_template", &data).unwrap()
        },
        (State::FullPrivilege, false) => {
            data.line_class = String::from("hollow");
            if rap.is_ref() {
                data.title += "; can read and write data; cannot point to another piece of data";
            } else {
                data.title += "; can only read data";
            }
            
            let mut hollow_internal_line_data = data.clone();
            hollow_internal_line_data.y1 += 5;
            hollow_internal_line_data.y2 -= 5;
            hollow_internal_line_data.title = data.title.to_owned();
            
            let output = format!("{}\n{}", registry.render("vertical_line_template", &data).unwrap(),
                                           registry.render("hollow_line_internal_template", &hollow_internal_line_data).unwrap());
            output
        },
        (State::PartialPrivilege{ borrow_count: _, borrow_to: _ }, _) => {
            data.line_class = String::from("solid");
            data.title += "; can only read data";
            // the background of the hollow line
            let final_line = registry.render("vertical_line_template", &data).unwrap();
            
            let mut hollow_internal_line_data = data.clone();
            hollow_internal_line_data.y1 += 5;
            hollow_internal_line_data.y2 -= 5;
            hollow_internal_line_data.title = data.title.to_owned();

            final_line + &registry.render("hollow_line_internal_template", &hollow_internal_line_data).unwrap()
        },
        (State::ResourceMoved{ move_to: _, move_at_line: _ }, true) => {
            data.line_class = String::from("extend");
            data.title += "; cannot access data";
            registry.render("vertical_line_template", &data).unwrap()
        }
        // do nothing when the case is (RevokedPrivilege, false), (OutofScope, _), (ResourceMoved, false)
        _ => (
            "".to_owned()
        ),
    }
}
// generate Reference Line(s) string from the RAP and its State
generate Reference Line(s) string from the RAP and its State
generate Reference Line ( s ) string from the RAP and its State
fn create_reference_line_string(
    rap: &ResourceAccessPoint,
    state: &State,
    data: &mut VerticalLineData,
    registry: &Handlebars,
) -> String {
    match (state, rap.is_mut()) {
        (State::FullPrivilege, true) => {
            data.line_class = String::from("solid");
            if rap.is_ref() {
                data.title += "; can read and write data; can point to another piece of data";
            } else {
                data.title += "; can read and write data";
            }
            registry.render("vertical_line_template", &data).unwrap()
        },
        (State::FullPrivilege, false) => {
            data.line_class = String::from("hollow");
            if rap.is_ref() {
                data.title += "; can read and write data; cannot point to another piece of data";
            } else {
                data.title += "; can only read data";
            }
            let mut hollow_internal_line_data = data.clone();
            hollow_internal_line_data.y1 += 5;
            hollow_internal_line_data.y2 -= 5;
            hollow_internal_line_data.title = data.title.to_owned();
            let output = format!("{}\n{}", registry.render("vertical_line_template", &data).unwrap(),
                                           registry.render("hollow_line_internal_template", &hollow_internal_line_data).unwrap());
            output
        },
        (State::PartialPrivilege{ borrow_count: _, borrow_to: _ }, _) => {
            data.line_class = String::from("solid");
            data.title += "; can only read data";
            // the background of the hollow line
            let final_line = registry.render("vertical_line_template", &data).unwrap();
            let mut hollow_internal_line_data = data.clone();
            hollow_internal_line_data.y1 += 5;
            hollow_internal_line_data.y2 -= 5;
            hollow_internal_line_data.title = data.title.to_owned();
            final_line + &registry.render("hollow_line_internal_template", &hollow_internal_line_data).unwrap()
        },
        (State::ResourceMoved{ move_to: _, move_at_line: _ }, true) => {
            data.line_class = String::from("extend");
            data.title += "; cannot access data";
            registry.render("vertical_line_template", &data).unwrap()
        }
        // do nothing when the case is (RevokedPrivilege, false), (OutofScope, _), (ResourceMoved, false)
        _ => (
            "".to_owned()
        ),
    }
}
fn create_reference_line_string ( rap : & ResourceAccessPoint , state : & State , data : & mut VerticalLineData , registry : & Handlebars , ) -> String { match ( state , rap . is_mut ( ) ) { ( State :: FullPrivilege , true ) => { data . line_class = String :: from ( " " ) ; if rap . is_ref ( ) { data . title += " " ; } else { data . title += " " ; } registry . render ( " " , & data ) . unwrap ( ) } , ( State :: FullPrivilege , false ) => { data . line_class = String :: from ( " " ) ; if rap . is_ref ( ) { data . title += " " ; } else { data . title += " " ; } let mut hollow_internal_line_data = data . clone ( ) ; hollow_internal_line_data . y1 += 5 ; hollow_internal_line_data . y2 -= 5 ; hollow_internal_line_data . title = data . title . to_owned ( ) ; let output = format ! ( " \n " registry render ( " " data ) unwrap ( ) registry render ( " " hollow_internal_line_data ) unwrap ( ) ) ; output } , ( State :: PartialPrivilege { borrow_count : _ , borrow_to : _ } , _ ) => { data . line_class = String :: from ( " " ) ; data . title += " " ; // the background of the hollow line let final_line = registry . render ( " " , & data ) . unwrap ( ) ; let mut hollow_internal_line_data = data . clone ( ) ; hollow_internal_line_data . y1 += 5 ; hollow_internal_line_data . y2 -= 5 ; hollow_internal_line_data . title = data . title . to_owned ( ) ; final_line + & registry . render ( " " , & hollow_internal_line_data ) . unwrap ( ) } , ( State :: ResourceMoved { move_to : _ , move_at_line : _ } , true ) => { data . line_class = String :: from ( " " ) ; data . title += " " ; registry . render ( " " , & data ) . unwrap ( ) } // do nothing when the case is (RevokedPrivilege, false), (OutofScope, _), (ResourceMoved, false) _ => ( " " . to_owned ( ) ) , } }
generate Reference Line(s) string from the RAP and its State
generate Reference Line ( s ) string from the RAP and its State
rap
&ResourceAccessPoint
state
&State
data
&mut VerticalLineData
registry
&Handlebars