userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
duration.cpp
1
#
include
<
userver
/
proto
-
structs
/
duration
.
hpp
>
2
3
#
include
<
fmt
/
format
.
h
>
4
5
#
include
<
userver
/
proto
-
structs
/
exceptions
.
hpp
>
6
#
include
<
userver
/
utils
/
impl
/
internal_tag
.
hpp
>
7
8
USERVER_NAMESPACE_BEGIN
9
10
namespace
proto_structs {
11
12
Duration::Duration(utils::impl::InternalTag, std::int64_t seconds, std::int32_t nanos)
13
: Duration(std::chrono::seconds{seconds}, std::chrono::nanoseconds{nanos})
14
{}
15
16
void
Duration::ThrowError(
const
std::chrono::seconds& seconds,
const
std::chrono::nanoseconds& nanos) {
17
throw
ValueError(fmt::format(
"Duration '{}s.{}ns' is invalid or out of range"
, seconds.count(), nanos.count()));
18
}
19
20
void
Duration::ThrowError(
const
char
* reason) {
throw
ValueError(reason); }
21
22
}
// namespace proto_structs
23
24
USERVER_NAMESPACE_END
proto-structs
src
proto-structs
duration.cpp
Generated on
for userver by
Doxygen
1.17.0