Enable dynamic access to the file access interface.

This commit is contained in:
Tom Alexander
2023-09-04 16:29:41 -04:00
parent 08eb59acd3
commit a7330e38e4
2 changed files with 11 additions and 10 deletions

View File

@@ -1,27 +1,26 @@
// use super::FileAccessInterface;
// use super::LocalFileAccessInterface;
use super::FileAccessInterface;
use super::LocalFileAccessInterface;
use crate::types::Object;
// TODO: Ultimately, I think we'll need most of this: https://orgmode.org/manual/In_002dbuffer-Settings.html
#[derive(Debug, Clone)]
// , F: FileAccessInterface
pub struct GlobalSettings<'g, 's> {
pub radio_targets: Vec<&'g Vec<Object<'s>>>,
// pub file_access: F,
pub file_access: &'g dyn FileAccessInterface,
}
impl<'g, 's> GlobalSettings<'g, 's> {
pub fn new() -> Self {
pub fn new() -> GlobalSettings<'g, 's> {
GlobalSettings {
radio_targets: Vec::new(),
// file_access: LocalFileAccessInterface,
file_access: &LocalFileAccessInterface,
}
}
}
impl<'g, 's> Default for GlobalSettings<'g, 's> {
fn default() -> Self {
fn default() -> GlobalSettings<'g, 's> {
GlobalSettings::new()
}
}