fn add_props<T>(&self, handles: &[T], state: &mut Vec<(T, PropertyValueSet)>) -> Result<(), Error>
    where
        T: ResourceHandle,
    {
        let iter = handles.iter().map(|x| (x, self.fd.get_properties(*x)));
        if let Some(len) = iter.size_hint().1 {
            state.reserve_exact(len)
        }

        iter.map(|(x, y)| (*x, y))
            .try_for_each(|(x, y)| match y {
                Ok(y) => {
                    state.push((x, y));
                    Ok(())
                }
                Err(err) => Err(err),
            })
            .map_err(|source| Error::Access {
                errmsg: "Error reading properties",
                dev: self.fd.dev_path(),
                source,
            })
    }
// Add all properties of given handles to a given drm resource type to state.
// You may use this to snapshot the current state of the drm device (fully or partially).
Add all properties of given handles to a given drm resource type to state.
You may use this to snapshot the current state of the drm device (fully or partially).
Add all properties of given handles to a given drm resource type to state . You may use this to snapshot the current state of the drm device ( fully or partially ) .
fn add_props<T>(&self, handles: &[T], state: &mut Vec<(T, PropertyValueSet)>) -> Result<(), Error>
    where
        T: ResourceHandle,
    {
        let iter = handles.iter().map(|x| (x, self.fd.get_properties(*x)));
        if let Some(len) = iter.size_hint().1 {
            state.reserve_exact(len)
        }
        iter.map(|(x, y)| (*x, y))
            .try_for_each(|(x, y)| match y {
                Ok(y) => {
                    state.push((x, y));
                    Ok(())
                }
                Err(err) => Err(err),
            })
            .map_err(|source| Error::Access {
                errmsg: "Error reading properties",
                dev: self.fd.dev_path(),
                source,
            })
    }
fn add_props < T > ( & self , handles : & [ T ] , state : & mut Vec < ( T , PropertyValueSet ) > ) -> Result < ( ) , Error > where T : ResourceHandle , { let iter = handles . iter ( ) . map ( | x | ( x , self . fd . get_properties ( * x ) ) ) ; if let Some ( len ) = iter . size_hint ( ) . 1 { state . reserve_exact ( len ) } iter . map ( | ( x , y ) | ( * x , y ) ) . try_for_each ( | ( x , y ) | match y { Ok ( y ) => { state . push ( ( x , y ) ) ; Ok ( ( ) ) } Err ( err ) => Err ( err ) , } ) . map_err ( | source | Error :: Access { errmsg : " " , dev : self . fd . dev_path ( ) , source , } ) }
Add all properties of given handles to a given drm resource type to state.
Add all properties of given handles to a given drm resource type to state .
&self
handles
&[T]
state
&mut Vec<(T, PropertyValueSet)>
&self
handles
&[T]
state
&mut Vec<(T, PropertyValueSet)>