pub struct Project { /* private fields */ }Expand description
A Cargo project made from code of the playground.
Implementations§
Source§impl Project
impl Project
Sourcepub fn new(title: impl Into<String>) -> Self
pub fn new(title: impl Into<String>) -> Self
A project with this title, which names the window, the page and, in lower case, the crate.
Sourcepub fn source(self, source: impl Into<String>) -> Self
pub fn source(self, source: impl Into<String>) -> Self
The code, as written. Its first function is what the window and the page show.
Sourcepub fn helper(self, code: impl Into<String>) -> Self
pub fn helper(self, code: impl Into<String>) -> Self
Code the source calls that the playground gave it, such as a helper of its examples. It goes after the source.
Sourcepub fn dependency(self, name: impl Into<String>, features: &[&str]) -> Self
pub fn dependency(self, name: impl Into<String>, features: &[&str]) -> Self
Uses another RavenRS crate, or turns features on in one already used.
Sourcepub fn records(self, json: impl Into<String>) -> Self
pub fn records(self, json: impl Into<String>) -> Self
The records the app had, as MemoryDatabase::export_json wrote them. They go in
src/seed.json, which SEED holds.
Sourcepub fn local_crates(self, root: impl Into<PathBuf>) -> Self
pub fn local_crates(self, root: impl Into<PathBuf>) -> Self
Takes the RavenRS crates from a checkout of the repository instead of crates.io, by
crates/<name> under root: for checking projects against code not published yet.
Sourcepub fn crate_name(&self) -> String
pub fn crate_name(&self) -> String
The name of the crate: the title in lower case, with - for what is not a letter or a
digit.
Sourcepub fn entry(&self) -> Result<String, String>
pub fn entry(&self) -> Result<String, String>
The function the app starts from: the first one of the source.
Sourcepub fn files_from_app(&self) -> Vec<ProjectFile>
pub fn files_from_app(&self) -> Vec<ProjectFile>
Project scaffolding for a complete app source, shared with cargo ravenrs new.
The source already exposes app(); its browser entry point stays unchanged.