pub fn update_outputs(
        &self,
        conn: &PgConnection,
        asset_group_id: i32,
        addr_to_id: &HashMap<String, i32>,
        repr: &ServiceRepr,
    ) -> Result<(), Error> {
        // Update service edges.
        let input_service_id = self.service_id;
        let mut new_edges: Vec<ServiceEdge> = Vec::with_capacity(repr.output_addresses.len());
        for output_addr in &repr.output_addresses {
            if let Some(&output_service_id) = addr_to_id.get(output_addr) {
                new_edges.push(ServiceEdge {
                    asset_group_id,
                    input_service_id,
                    output_service_id,
                });
            } else {
                return Err(Error::DatabaseSyncError(format!(
                    "Failed to find service with address '{}'",
                    output_addr
                )));
            }
        }
        ServiceEdge::delete_outputs(conn, input_service_id)?;
        new_edges.insert_all(conn)?;
        Ok(())
    }
/// Updates outputs based on respresentation.
Updates outputs based on respresentation.
Updates outputs based on respresentation .
pub fn update_outputs(
        &self,
        conn: &PgConnection,
        asset_group_id: i32,
        addr_to_id: &HashMap<String, i32>,
        repr: &ServiceRepr,
    ) -> Result<(), Error> {
        // Update service edges.
        let input_service_id = self.service_id;
        let mut new_edges: Vec<ServiceEdge> = Vec::with_capacity(repr.output_addresses.len());
        for output_addr in &repr.output_addresses {
            if let Some(&output_service_id) = addr_to_id.get(output_addr) {
                new_edges.push(ServiceEdge {
                    asset_group_id,
                    input_service_id,
                    output_service_id,
                });
            } else {
                return Err(Error::DatabaseSyncError(format!(
                    "Failed to find service with address '{}'",
                    output_addr
                )));
            }
        }
        ServiceEdge::delete_outputs(conn, input_service_id)?;
        new_edges.insert_all(conn)?;
        Ok(())
    }
pub fn update_outputs ( & self , conn : & PgConnection , asset_group_id : i32 , addr_to_id : & HashMap < String , i32 > , repr : & ServiceRepr , ) -> Result < ( ) , Error > { // Update service edges. let input_service_id = self . service_id ; let mut new_edges : Vec < ServiceEdge > = Vec :: with_capacity ( repr . output_addresses . len ( ) ) ; for output_addr in & repr . output_addresses { if let Some ( & output_service_id ) = addr_to_id . get ( output_addr ) { new_edges . push ( ServiceEdge { asset_group_id , input_service_id , output_service_id , } ) ; } else { return Err ( Error :: DatabaseSyncError ( format ! ( " " output_addr ) ) ) ; } } ServiceEdge :: delete_outputs ( conn , input_service_id ) ? ; new_edges . insert_all ( conn ) ? ; Ok ( ( ) ) }
Updates outputs based on respresentation.
Updates outputs based on respresentation .
&self
conn
&PgConnection
asset_group_id
i32
addr_to_id
&HashMap<String, i32>
repr
&ServiceRepr
&self
conn
&PgConnection
asset_group_id
i32
addr_to_id
&HashMap<String, i32>
repr
&ServiceRepr