pub fn handle_c_error<T>(result: Result<T, Error>, errout: Option<&mut Buffer>) -> Vec<u8>
where
    T: Into<Vec<u8>>,
{
    match result {
        Ok(value) => {
            clear_error();
            value.into()
        }
        Err(error) => {
            set_error(error, errout);
            Vec::new()
        }
    }
}
/// If `result` is Ok, this returns the binary representation of the Ok value and clears the error in `errout`.
/// Otherwise it returns an empty vector and writes the error to `errout`.
If `result` is Ok, this returns the binary representation of the Ok value and clears the error in `errout`.
Otherwise it returns an empty vector and writes the error to `errout`.
If ` result ` is Ok this returns the binary representation of the Ok value and clears the error in ` errout ` . Otherwise it returns an empty vector and writes the error to ` errout ` .
pub fn handle_c_error<T>(result: Result<T, Error>, errout: Option<&mut Buffer>) -> Vec<u8>
where
    T: Into<Vec<u8>>,
{
    match result {
        Ok(value) => {
            clear_error();
            value.into()
        }
        Err(error) => {
            set_error(error, errout);
            Vec::new()
        }
    }
}
pub fn handle_c_error < T > ( result : Result < T , Error > , errout : Option < & mut Buffer > ) -> Vec < u8 > where T : Into < Vec < u8 > > , { match result { Ok ( value ) => { clear_error ( ) ; value . into ( ) } Err ( error ) => { set_error ( error , errout ) ; Vec :: new ( ) } } }
If `result` is Ok, this returns the binary representation of the Ok value and clears the error in `errout`.
If ` result ` is Ok this returns the binary representation of the Ok value and clears the error in ` errout ` .
result
Result<T, Error>
errout
Option<&mut Buffer>