Trait FileTreeSourceFactory

Source
pub trait FileTreeSourceFactory:
    Send
    + Sync
    + 'static {
    // Required method
    fn create(&self) -> Result<Box<dyn FileTreeSource>, FileError>;
}
Expand description

Thread-safe factory that creates one worker-owned source instance.

§Examples

use ailloli_ui_fs::{FileError, FileTreeSource, FileTreeSourceFactory};
fn open(factory: &dyn FileTreeSourceFactory) -> Result<Box<dyn FileTreeSource>, FileError> { factory.create() }

Required Methods§

Source

fn create(&self) -> Result<Box<dyn FileTreeSource>, FileError>

Creates a fresh source instance for exclusive ownership by one worker.

§Errors

Returns a provider FileError when the source cannot be initialized.

§Examples
use ailloli_ui_fs::{FileError, FileTreeSource, FileTreeSourceFactory};
fn create(factory: &dyn FileTreeSourceFactory) -> Result<Box<dyn FileTreeSource>, FileError> { factory.create() }

Implementors§