FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pendulum/rust/src/python/types/precise_diff.rs at master · python-pendulum/pendulum · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
python-pendulum
/
pendulum
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
445
Star
6.7k
Code
Issues
206
Pull requests
60
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pendulum
/
rust
/
src
/
python
/
types
/
precise_diff.rs
Copy path
More file actions
More file actions
Latest commit
History
History
History
53 lines (50 loc) · 1.53 KB
Breadcrumbs
pendulum
/
rust
/
src
/
python
/
types
/
precise_diff.rs
Copy path
File metadata and controls
53 lines (50 loc) · 1.53 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use
pyo3
::
prelude
::
*
;
#
[
pyclass
(
module =
"_pendulum"
)
]
pub
struct
PreciseDiff
{
#
[
pyo3
(
get
,
set
)
]
pub
years
:
i32
,
#
[
pyo3
(
get
,
set
)
]
pub
months
:
i32
,
#
[
pyo3
(
get
,
set
)
]
pub
days
:
i32
,
#
[
pyo3
(
get
,
set
)
]
pub
hours
:
i32
,
#
[
pyo3
(
get
,
set
)
]
pub
minutes
:
i32
,
#
[
pyo3
(
get
,
set
)
]
pub
seconds
:
i32
,
#
[
pyo3
(
get
,
set
)
]
pub
microseconds
:
i32
,
#
[
pyo3
(
get
,
set
)
]
pub
total_days
:
i32
,
}
#
[
pymethods
]
impl
PreciseDiff
{
#
[
new
]
#
[
pyo3
(
signature =
(
years=
0
,
months=
0
,
days=
0
,
hours=
0
,
minutes=
0
,
seconds=
0
,
microseconds=
0
,
total_days=
0
)
)
]
#
[
allow
(
clippy
::
too_many_arguments
)
]
pub
fn
new
(
years
:
Option
<
i32
>
,
months
:
Option
<
i32
>
,
days
:
Option
<
i32
>
,
hours
:
Option
<
i32
>
,
minutes
:
Option
<
i32
>
,
seconds
:
Option
<
i32
>
,
microseconds
:
Option
<
i32
>
,
total_days
:
Option
<
i32
>
,
)
->
Self
{
Self
{
years
:
years
.
unwrap_or
(
0
)
,
months
:
months
.
unwrap_or
(
0
)
,
days
:
days
.
unwrap_or
(
0
)
,
hours
:
hours
.
unwrap_or
(
0
)
,
minutes
:
minutes
.
unwrap_or
(
0
)
,
seconds
:
seconds
.
unwrap_or
(
0
)
,
microseconds
:
microseconds
.
unwrap_or
(
0
)
,
total_days
:
total_days
.
unwrap_or
(
0
)
,
}
}
fn
__repr__
(
&
self
)
->
String
{
format
!
(
"PreciseDiff(years={}, months={}, days={}, hours={}, minutes={}, seconds={}, microseconds={}, total_days={})"
,
self
.
years
,
self
.
months
,
self
.
days
,
self
.
hours
,
self
.
minutes
,
self
.
seconds
,
self
.
microseconds
,
self
.
total_days
)
}
}
Back
|
FazBrowse Home
|
New Git URL