pub struct Workspace {
pub cartridges: Vec<Cartridge>,
pub module_roots: Vec<PathBuf>,
pub paths: Vec<CartridgePath>,
/* private fields */
}Fields§
§cartridges: Vec<Cartridge>§module_roots: Vec<PathBuf>cartridges/modules folders, which hold plain CommonJS modules such as
server that are required without a cartridge/ segment.
paths: Vec<CartridgePath>Implementations§
Source§impl Workspace
impl Workspace
Sourcepub fn scan(roots: &[PathBuf], settings: &Value) -> Self
pub fn scan(roots: &[PathBuf], settings: &Value) -> Self
The heavier indexes are left until something asks for them.
pub fn cartridge_of(&self, file: &Path) -> Option<&Cartridge>
Sourcepub fn cartridges_from(&self, file: &Path) -> Vec<&Cartridge>
pub fn cartridges_from(&self, file: &Path) -> Vec<&Cartridge>
Every cartridge, with the one owning file first: */cartridge/...
most often means “this cartridge, then the rest of the path”.
Sourcepub fn templates(&self) -> &[String]
pub fn templates(&self) -> &[String]
Template paths as SFCC spells them: no locale folder, no .isml, forward slashes.
Deduplicated, since the same path exists in every overriding cartridge.
Sourcepub fn resource_keys(&self) -> &HashSet<String>
pub fn resource_keys(&self) -> &HashSet<String>
Keys of every default bundle; which bundle is not recorded, since a form resolves labels against several.
pub fn controllers(&self) -> &Controllers
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Workspace
impl RefUnwindSafe for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnsafeUnpin for Workspace
impl UnwindSafe for Workspace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more