fn serialize(&self, mem: &[u8], fd: &[u8], shared: &[u8]) -> Vec<SerializationInfo> {
        self.args
            .iter()
            .map(|&(off, ref arg)|
                 arg.serialize(&mem[off..off+arg.size()], fd, shared)
                    .into_iter()
                    .map(move |mut info| {
                        info.offset += off;
                        info })
                    .collect::< Vec<SerializationInfo> >()
            )
            .flat_map(move |info| info)
            .collect::< Vec<SerializationInfo> >()
        /*
        //imperative alternative, tested for speed and #lines; FP faster and just bit longer + no
        //temporary variable!
        let mut infos: Vec<SerializationInfo> = Vec::new();
        for &(off, ref arg) in self.args.iter() {
            for mut info in arg.serialize(&mem[off..off+arg.size()]).into_iter() {
                info.offset += off;
                infos.push(info);
            }
        }
        infos
        */
    }
/// 1. we want to walk trough all aruments
/// 2. serialize all of them
/// 3. update their particular offset ( as those are non-overlapped and together build argument )
/// 4. forward it to caller
///
/// # Example
/// ```
/// impl ISerializableArg for TestArg { }
/// ```
/// ```
/// fn serialize(&self, mem: &[u8], fd: &[u8]) -> Vec<SerializationInfo> {
///     vec![
///         SerializationInfo {
///             offset : 0,
///             prefix : String::from("special("),
///         }]
/// }
/// ```
1. we want to walk trough all aruments
2. serialize all of them
3. update their particular offset ( as those are non-overlapped and together build argument )
4. forward it to caller
1 . we want to walk trough all aruments 2 . serialize all of them 3 . update their particular offset ( as those are non - overlapped and together build argument ) 4 . forward it to caller
fn serialize(&self, mem: &[u8], fd: &[u8], shared: &[u8]) -> Vec<SerializationInfo> {
        self.args
            .iter()
            .map(|&(off, ref arg)|
                 arg.serialize(&mem[off..off+arg.size()], fd, shared)
                    .into_iter()
                    .map(move |mut info| {
                        info.offset += off;
                        info })
                    .collect::< Vec<SerializationInfo> >()
            )
            .flat_map(move |info| info)
            .collect::< Vec<SerializationInfo> >()
        /*
        //imperative alternative, tested for speed and #lines; FP faster and just bit longer + no
        //temporary variable!
        let mut infos: Vec<SerializationInfo> = Vec::new();
        for &(off, ref arg) in self.args.iter() {
            for mut info in arg.serialize(&mem[off..off+arg.size()]).into_iter() {
                info.offset += off;
                infos.push(info);
            }
        }
        infos
        */
    }
fn serialize ( & self , mem : & [ u8 ] , fd : & [ u8 ] , shared : & [ u8 ] ) -> Vec < SerializationInfo > { self . args . iter ( ) . map ( | & ( off , ref arg ) | arg . serialize ( & mem [ off .. off + arg . size ( ) ] , fd , shared ) . into_iter ( ) . map ( move | mut info | { info . offset += off ; info } ) . collect :: < Vec < SerializationInfo > > ( ) ) . flat_map ( move | info | info ) . collect :: < Vec < SerializationInfo > > ( ) /*
        //imperative alternative, tested for speed and #lines; FP faster and just bit longer + no
        //temporary variable!
        let mut infos: Vec<SerializationInfo> = Vec::new();
        for &(off, ref arg) in self.args.iter() {
            for mut info in arg.serialize(&mem[off..off+arg.size()]).into_iter() {
                info.offset += off;
                infos.push(info);
            }
        }
        infos
        */ }
1. we want to walk trough all aruments
2. serialize all of them
3. update their particular offset ( as those are non-overlapped and together build argument )
4. forward it to caller
1 . we want to walk trough all aruments 2 . serialize all of them 3 . update their particular offset ( as those are non - overlapped and together build argument ) 4 . forward it to caller
&self
mem
&[u8]
fd
&[u8]
shared
&[u8]
&self
mem
&[u8]
fd
&[u8]
shared
&[u8]
example
```
impl ISerializableArg for TestArg { }
```
```
fn serialize(&self, mem: &[u8], fd: &[u8]) -> Vec {
vec![
SerializationInfo {
offset : 0,
prefix : String::from("special("),
}]
}
```
` ` ` impl ISerializableArg for TestArg { } ` ` ` ` ` ` fn serialize ( &self mem : & [ u8 ] fd : & [ u8 ] ) - > Vec { vec! [ SerializationInfo { offset : 0 prefix : String :: from ( " special ( " ) } ] } ` ` `