From de4746c48eb135e8ca7762e24894befc4306b56a Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Tue, 18 Jun 2024 09:13:18 +0200 Subject: [PATCH] AbstractFilesystem: Add doc comments --- src/afs.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/afs.rs b/src/afs.rs index fd1e800..b67ee70 100644 --- a/src/afs.rs +++ b/src/afs.rs @@ -3,10 +3,20 @@ use std::fs::read_dir; use std::io; use std::path::Path; +/// A trait for abstracting over filesystem operations. +/// +/// This trait is primarily used for target auto-discovery in the +/// [`complete_from_abstract_filesystem()`](crate::Manifest::complete_from_abstract_filesystem) method. pub trait AbstractFilesystem { + /// Returns a set of file and folder names in the given directory. + /// + /// This method should return a [std::io::ErrorKind::NotFound] error if the + /// directory does not exist. fn file_names_in(&self, rel_path: &str) -> io::Result>>; } +/// A [AbstractFilesystem] implementation that reads from the actual filesystem +/// within the given root path. pub struct Filesystem<'a> { path: &'a Path, }