pub fn replace(&self, mut data: Vec<T>) -> crate::Result<Vec<T>> {
        let mut index = 0;

        for masked_byte in &self.values {
            match data.get_mut(index) {
                Some(byte) => {
                    *byte = masked_byte.set(*byte);
                }
                None => match masked_byte.defined() {
                    Some(value) => data.push(value),
                    None => return Err(crate::Error::ReplaceNotDefined),
                },
            }

            index += 1;
        }
        Ok(data)
    }
// data is taken, elements are replaced/added and returned
data is taken, elements are replaced/added and returned
data is taken elements are replaced / added and returned
pub fn replace(&self, mut data: Vec<T>) -> crate::Result<Vec<T>> {
        let mut index = 0;
        for masked_byte in &self.values {
            match data.get_mut(index) {
                Some(byte) => {
                    *byte = masked_byte.set(*byte);
                }
                None => match masked_byte.defined() {
                    Some(value) => data.push(value),
                    None => return Err(crate::Error::ReplaceNotDefined),
                },
            }
            index += 1;
        }
        Ok(data)
    }
pub fn replace ( & self , mut data : Vec < T > ) -> crate :: Result < Vec < T > > { let mut index = 0 ; for masked_byte in & self . values { match data . get_mut ( index ) { Some ( byte ) => { * byte = masked_byte . set ( * byte ) ; } None => match masked_byte . defined ( ) { Some ( value ) => data . push ( value ) , None => return Err ( crate :: Error :: ReplaceNotDefined ) , } , } index += 1 ; } Ok ( data ) }
data is taken, elements are replaced/added and returned
data is taken elements are replaced / added and returned
&self
data
Vec<T>