pub fn write_option_cb<W: Writer, T, F>(
    t: &Option<T>,
    writer: &mut W,
    cb: &F,
) -> Result<(), ::std::io::Error>
where
    F: Fn(&T, &mut W) -> Result<(), ::std::io::Error>,
{
    match t {
        Some(t) => {
            1_u8.write(writer)?;
            cb(t, writer)
        }
        None => 0_u8.write(writer),
    }
}
/// Writes an option using the provided callback to serialize the inner value (if any).
Writes an option using the provided callback to serialize the inner value (if any).
Writes an option using the provided callback to serialize the inner value ( if any ) .
pub fn write_option_cb<W: Writer, T, F>(
    t: &Option<T>,
    writer: &mut W,
    cb: &F,
) -> Result<(), ::std::io::Error>
where
    F: Fn(&T, &mut W) -> Result<(), ::std::io::Error>,
{
    match t {
        Some(t) => {
            1_u8.write(writer)?;
            cb(t, writer)
        }
        None => 0_u8.write(writer),
    }
}
pub fn write_option_cb < W : Writer , T , F > ( t : & Option < T > , writer : & mut W , cb : & F , ) -> Result < ( ) , :: std :: io :: Error > where F : Fn ( & T , & mut W ) -> Result < ( ) , :: std :: io :: Error > , { match t { Some ( t ) => { 1_u8 . write ( writer ) ? ; cb ( t , writer ) } None => 0_u8 . write ( writer ) , } }
Writes an option using the provided callback to serialize the inner value (if any).
Writes an option using the provided callback to serialize the inner value ( if any ) .
t
&Option<T>
writer
&mut W
cb
&F