lua-modules/lua_modules/filesystem/src/resource/mod.rs

18 lines
735 B
Rust

use crate::sink::ResourceSink;
use crate::source::ResourceSource;
/// Points to a resource. Think of it as a path.
pub trait ResourceLocation {
fn location(&self) -> String;
}
/// A concrete resource. Think of as a directory or a file
pub trait Resource {}
// A resource ready to be read. Think of it as a open file for reading
pub trait ResourceInputStream: std::io::Read {}
// A resource ready to be written. Think of it as a open file for reading
pub trait ResourceOutputStream: std::io::Write {}
pub type DynResource = Box<dyn Resource>;
pub type DynResourceLocation = Box<dyn ResourceLocation>;
pub type DynResourceInputStream = Box<dyn ResourceInputStream>;
pub type DynResourceOutputStream = Box<dyn ResourceOutputStream>;