ignore.hpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* Copyright (c) 2018-2024 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. /** @brief Type used to ignore responses.
  13. *
  14. * For example:
  15. *
  16. * @code
  17. * response<ignore_t, std::string, ignore_t> resp;
  18. * @endcode
  19. *
  20. * This will ignore the first and third responses. RESP3 errors won't be
  21. * ignore but will cause `async_exec` to complete with an error.
  22. */
  23. using ignore_t = std::decay_t<decltype(std::ignore)>;
  24. /** @brief Global ignore object.
  25. *
  26. * Can be used to ignore responses to a request. For example:
  27. *
  28. * @code
  29. * co_await conn.async_exec(req, ignore);
  30. * @endcode
  31. *
  32. * RESP3 errors won't be ignore but will cause `async_exec` to
  33. * complete with an error.
  34. */
  35. extern ignore_t ignore;
  36. } // namespace boost::redis
  37. #endif // BOOST_REDIS_IGNORE_HPP