fn write_magic(msg_type: u8, dst: &mut [u8]) -> Result<usize, &'static str> {
    if dst.len() < 5 {
        return Err("not enought space");
    }
    dst[0] = 0xCA;
    dst[1] = 0x11;
    dst[2] = 3; // FRPC_MAJOR_VERSION
    dst[3] = 0; // FRPC_MINOR_VERSION
    dst[4] = msg_type;
    Ok(5)
}
/** Writes protocol header and message type
 * @return Number of bytes written or zero when there is not enough room
 */
Writes protocol header and message type
@return Number of bytes written or zero when there is not enough room
Writes protocol header and message type @return Number of bytes written or zero when there is not enough room
fn write_magic(msg_type: u8, dst: &mut [u8]) -> Result<usize, &'static str> {
    if dst.len() < 5 {
        return Err("not enought space");
    }
    dst[0] = 0xCA;
    dst[1] = 0x11;
    dst[2] = 3; // FRPC_MAJOR_VERSION
    dst[3] = 0; // FRPC_MINOR_VERSION
    dst[4] = msg_type;
    Ok(5)
}
fn write_magic ( msg_type : u8 , dst : & mut [ u8 ] ) -> Result < usize , & ' static str > { if dst . len ( ) < 5 { return Err ( " " ) ; } dst [ 0 ] = 0xCA ; dst [ 1 ] = 0x11 ; dst [ 2 ] = 3 ; // FRPC_MAJOR_VERSION dst [ 3 ] = 0 ; // FRPC_MINOR_VERSION dst [ 4 ] = msg_type ; Ok ( 5 ) }
Writes protocol header and message type
 @return Number of bytes written or zero when there is not enough room
Writes protocol header and message type @return Number of bytes written or zero when there is not enough room
msg_type
u8
dst
&mut [u8]
msg_type
u8
dst
&mut [u8]