/// Format SPU Group based on output type
Format SPU Group based on output type
Format SPU Group based on output type
pub fn spu_group_response_to_output<O: Terminal>(
    out: std::sync::Arc<O>,
    spu_groups: FlvFetchSpuGroupsResponse,
    output_type: OutputType,
) -> Result<(), CliError> {
    let groups = spu_groups.spu_groups;
    // TODO: display error output
    let list_spu_groups: Vec<SpuGroupRow> = groups
            .into_iter()
            .map(|g| {
               let  (name,spec,status) = g.into();
                SpuGroupRow {
                    name,
                    spec,
                    status
                }
            }).collect();
    debug!("groups: {:#?}",list_spu_groups);
    if list_spu_groups.len() > 0 {
        out.render_list(&list_spu_groups,output_type)
    } else {
        t_println!(out,"no groups");
        Ok(())
    }
}
pub fn spu_group_response_to_output < O : Terminal > ( out : std :: sync :: Arc < O > , spu_groups : FlvFetchSpuGroupsResponse , output_type : OutputType , ) -> Result < ( ) , CliError > { let groups = spu_groups . spu_groups ; // TODO: display error output let list_spu_groups : Vec < SpuGroupRow > = groups . into_iter ( ) . map ( | g | { let ( name , spec , status ) = g . into ( ) ; SpuGroupRow { name , spec , status } } ) . collect ( ) ; debug ! ( " " list_spu_groups ) ; if list_spu_groups . len ( ) > 0 { out . render_list ( & list_spu_groups , output_type ) } else { t_println ! ( out " " ) ; Ok ( ( ) ) } }
Format SPU Group based on output type
Format SPU Group based on output type
out
std::sync::Arc<O>
spu_groups
FlvFetchSpuGroupsResponse
output_type
OutputType