/// Replace the list of available display devices with the given collection and send a
/// `fuchsia.hardware.display.Controller.OnDisplaysChanged` event reflecting the changes.
///
/// All the new displays will be reported as added while previously present displays will
/// be reported as removed, regardless of their content.
///
/// Returns an error if `displays` contains entries with repeated display IDs.
Replace the list of available display devices with the given collection and send a
`fuchsia.hardware.display.Controller.OnDisplaysChanged` event reflecting the changes.

All the new displays will be reported as added while previously present displays will
be reported as removed, regardless of their content.

Returns an error if `displays` contains entries with repeated display IDs.
Replace the list of available display devices with the given collection and send a ` fuchsia . hardware . display . Controller . OnDisplaysChanged ` event reflecting the changes . All the new displays will be reported as added while previously present displays will be reported as removed regardless of their content . Returns an error if ` displays ` contains entries with repeated display IDs .
pub fn assign_displays(&mut self, displays: Vec<display::Info>) -> Result<()> {
        let mut added = HashMap::new();
        if !displays.into_iter().all(|info| added.insert(DisplayId(info.id), info).is_none()) {
            return Err(MockControllerError::DuplicateIds);
        }
        let removed: Vec<u64> = self.displays.iter().map(|(_, info)| info.id).collect();
        self.displays = added;
        self.control_handle.send_on_displays_changed(
            &mut self.displays.iter_mut().sorted().map(|(_, info)| info),
            &removed,
        )?;
        Ok(())
    }
pub fn assign_displays ( & mut self , displays : Vec < display :: Info > ) -> Result < ( ) > { let mut added = HashMap :: new ( ) ; if ! displays . into_iter ( ) . all ( | info | added . insert ( DisplayId ( info . id ) , info ) . is_none ( ) ) { return Err ( MockControllerError :: DuplicateIds ) ; } let removed : Vec < u64 > = self . displays . iter ( ) . map ( | ( _ , info ) | info . id ) . collect ( ) ; self . displays = added ; self . control_handle . send_on_displays_changed ( & mut self . displays . iter_mut ( ) . sorted ( ) . map ( | ( _ , info ) | info ) , & removed , ) ? ; Ok ( ( ) ) }
Replace the list of available display devices with the given collection and send a
`fuchsia.hardware.display.Controller.OnDisplaysChanged` event reflecting the changes.
Replace the list of available display devices with the given collection and send a ` fuchsia . hardware . display . Controller . OnDisplaysChanged ` event reflecting the changes .
&mut self
displays
Vec<display::Info>