ignore.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* Copyright (c) 2018-2023 Marcelo Zimbres Silva (mzimbres@gmail.com)
  2. *
  3. * Distributed under the Boost Software License, Version 1.0. (See
  4. * accompanying file LICENSE.txt)
  5. */
  6. #ifndef BOOST_REDIS_IGNORE_HPP
  7. #define BOOST_REDIS_IGNORE_HPP
  8. #include <boost/system/result.hpp>
  9. #include <tuple>
  10. #include <type_traits>
  11. namespace boost::redis
  12. {
  13. /** @brief Type used to ignore responses.
  14. * @ingroup high-level-api
  15. *
  16. * For example
  17. *
  18. * @code
  19. * response<ignore_t, std::string, ignore_t> resp;
  20. * @endcode
  21. *
  22. * will ignore the first and third responses. RESP3 errors won't be
  23. * ignore but will cause `async_exec` to complete with an error.
  24. */
  25. using ignore_t = std::decay_t<decltype(std::ignore)>;
  26. /** @brief Global ignore object.
  27. * @ingroup high-level-api
  28. *
  29. * Can be used to ignore responses to a request
  30. *
  31. * @code
  32. * conn->async_exec(req, ignore, ...);
  33. * @endcode
  34. *
  35. * RESP3 errors won't be ignore but will cause `async_exec` to
  36. * complete with an error.
  37. */
  38. extern ignore_t ignore;
  39. } // boost::redis
  40. #endif // BOOST_REDIS_IGNORE_HPP