the return type of `write_callback_func` is size_t