Does <'a, 'b: 'a> mean that the lifetime 'b must outlive the lifetime 'a?

前端 未结 2 1651
抹茶落季
抹茶落季 2020-12-10 02:30

I want to implement a builder similar to the debug builders defined by the standard library. They are defined using structures like the following:

struct Deb         


        
2条回答
  •  一生所求
    2020-12-10 02:50

    Yes, you're broadly right.

    A bound <...: 'a> means that ... (either a type or another lifetime) needs to be able to outlive 'a. E.g. 'b: 'a means that "'b must live at least as long as 'a" (not strictly outlives, though: they can be the same).

提交回复
热议问题