Lifetime in pyclass #2545
Answered
by
mejrs
Cryptex-github
asked this question in
Questions
Lifetime in pyclass
#2545
-
So I have this code here #[pyclass]
pub struct TextSegment<'t> {
inner: RilTextSegment<'t, Dynamic>
} But I am getting the following error
So my question is why is it not possible to have named lifetime in pyclass, and what can you possibly do to get around it? |
Beta Was this translation helpful? Give feedback.
Answered by
mejrs
Aug 12, 2022
Replies: 1 comment 1 reply
-
You can't have them because Python has no concept of lifetimes. Once you give something to Python, it can keep it around forever, thus it cannot have a lifetime. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Cryptex-github
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can't have them because Python has no concept of lifetimes. Once you give something to Python, it can keep it around forever, thus it cannot have a lifetime.