pub struct VanProject {
pub root: PathBuf,
pub config: VanConfig,
}Expand description
A loaded Van project, providing file collection and mock data utilities.
Fields§
§root: PathBuf§config: VanConfigImplementations§
Source§impl VanProject
impl VanProject
Sourcepub fn collect_files(&self) -> Result<HashMap<String, String>>
pub fn collect_files(&self) -> Result<HashMap<String, String>>
Collect all source files (.van, .ts, .js) from src/ and node_modules/@scope/.
Returns a HashMap keyed by relative path (e.g. "pages/index.van").
Sourcepub fn load_mock_data(&self, page_key: &str) -> Value
pub fn load_mock_data(&self, page_key: &str) -> Value
Load page-specific mock data from mock/index.json.
Tries page-specific key first (e.g. "pages/index"), falls back to root object.
Sourcepub fn load_all_mock_data(&self) -> Value
pub fn load_all_mock_data(&self) -> Value
Load all mock data from mock/index.json.
Sourcepub fn page_entries(&self, files: &HashMap<String, String>) -> Vec<String>
pub fn page_entries(&self, files: &HashMap<String, String>) -> Vec<String>
Find all page entries (files under pages/ with .van extension).
Sourcepub fn component_entries(&self, files: &HashMap<String, String>) -> Vec<String>
pub fn component_entries(&self, files: &HashMap<String, String>) -> Vec<String>
Find all component entries (files under components/ with .van extension).
pub fn src_dir(&self) -> PathBuf
pub fn pages_dir(&self) -> PathBuf
pub fn dist_dir(&self) -> PathBuf
Trait Implementations§
Source§impl Clone for VanProject
impl Clone for VanProject
Source§fn clone(&self) -> VanProject
fn clone(&self) -> VanProject
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VanProject
impl RefUnwindSafe for VanProject
impl Send for VanProject
impl Sync for VanProject
impl Unpin for VanProject
impl UnsafeUnpin for VanProject
impl UnwindSafe for VanProject
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