Ancestors
Ancestors (경로 조상 반복자 구조체)
Path와 그 조상들을 순회하는 반복자예요.
출처: Rust 공식 문서
본문
이 구조체는 Path의 ancestors 메서드에 의해 생성돼요. 자세한 내용은 해당 메서드 문서를 참고하세요.
pub struct Ancestors<'a> { /* private fields */ }
예시
use std::path::Path;
let path = Path::new("/foo/bar");
for ancestor in path.ancestors() {
println!("{ancestor:?}");
}