How do I specify lifetime parameters in an associated type?

后端 未结 3 365
星月不相逢
星月不相逢 2020-11-29 07:26

I have this trait and simple structure:

use std::path::{Path, PathBuf};

trait Foo {
    type Item: AsRef;
    type Iter: Iterator

        
3条回答
  •  暖寄归人
    2020-11-29 07:47

    In future, you'll want an associated type constructor for your lifetime 'a but Rust does not support that yet. See RFC 1598

提交回复
热议问题