Skip to main content

Workspace

Trait Workspace 

Source
pub trait Workspace {
    // Required methods
    fn program(&self, path: &str) -> GeopResult<Rc<Program>>;
    fn read(&self, path: &str) -> GeopResult<Rc<str>>;
    fn list(&self) -> Vec<String>;
    fn resolve(&self, from: &str, name: &str) -> String;
    fn relative(&self, from: &str, path: &str) -> String;
    fn revision(&self, path: &str) -> u64;

    // Provided methods
    fn cache(&self) -> Option<&Cache> { ... }
    fn digest(&self, path: &str) -> Option<u128> { ... }
}
Expand description

Programs and other files, by path.

Required Methods§

Source

fn program(&self, path: &str) -> GeopResult<Rc<Program>>

The program in the file at path, with the state it was saved with: the same each time it is asked for while the file does not change.

Source

fn read(&self, path: &str) -> GeopResult<Rc<str>>

The text of the file at path: a STEP file a step imports. The same each time it is asked for while the file does not change.

Source

fn list(&self) -> Vec<String>

Every file there is, by path.

Source

fn resolve(&self, from: &str, name: &str) -> String

The path of the file the file at from names name.

Source

fn relative(&self, from: &str, path: &str) -> String

How the file at from names the file at path.

Source

fn revision(&self, path: &str) -> u64

The revision of the file at path: changes whenever the file does, so a node that read it is made again.

Provided Methods§

Source

fn cache(&self) -> Option<&Cache>

What it keeps of what its files were made into, shared by every build reading them: none, for a workspace that keeps nothing, whose files are made into what they read as each time they are read.

Source

fn digest(&self, path: &str) -> Option<u128>

A digest of the text of the file at path as it is now: what a node that read it was made from, in any process (see crate::kept). None for a file it does not have.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F: FileStore + 'static> Workspace for Files<F>