pub struct Builder {
pub name: String,
pub version: String,
pub force_rebuild: bool,
pub env: Vec<(String, String)>,
pub features: Vec<String>,
pub target: String,
pub output_dir: Option<PathBuf>,
pub cargo_args: Vec<String>,
pub source_dir: Option<PathBuf>,
pub manifest_path: Option<PathBuf>,
}Fields§
§name: String§version: String§force_rebuild: bool§env: Vec<(String, String)>§features: Vec<String>§target: String§output_dir: Option<PathBuf>§cargo_args: Vec<String>§source_dir: Option<PathBuf>§manifest_path: Option<PathBuf>Implementations§
Source§impl Builder
impl Builder
Sourcepub fn new(name: &str, version: &str, target: &str) -> Self
pub fn new(name: &str, version: &str, target: &str) -> Self
Examples found in repository?
examples/run.rs (lines 8-12)
5fn main() {
6 let mf = std::env::var("CARGO_MANIFEST_DIR").unwrap();
7 println!("manifest dir: {mf}");
8 let mut builder = Builder::new(
9 "pie-boot-loader-aarch64",
10 "0.1.2",
11 "aarch64-unknown-none-softfloat",
12 );
13 builder.output_dir = Some(Path::new(&mf).join("target/tmp"));
14 println!("building..");
15 builder.build().unwrap();
16}More examples
examples/run_local.rs (lines 8-12)
5fn main() {
6 let mf = std::env::var("CARGO_MANIFEST_DIR").unwrap();
7 println!("manifest dir: {mf}");
8 let mut builder = Builder::new(
9 "pie-boot-loader-aarch64",
10 "0.1.2",
11 "aarch64-unknown-none-softfloat",
12 )
13 .source_dir(Path::new("/home/zhourui/opensource/pie-boot"));
14 builder.output_dir = Some(Path::new(&mf).join("target/tmp"));
15 println!("building..");
16 builder.build().unwrap();
17}pub fn env(self, key: &str, value: &str) -> Self
pub fn feature(self, feature: &str) -> Self
Sourcepub fn source_dir<T: AsRef<Path>>(self, dir: T) -> Self
pub fn source_dir<T: AsRef<Path>>(self, dir: T) -> Self
Examples found in repository?
examples/run_local.rs (line 13)
5fn main() {
6 let mf = std::env::var("CARGO_MANIFEST_DIR").unwrap();
7 println!("manifest dir: {mf}");
8 let mut builder = Builder::new(
9 "pie-boot-loader-aarch64",
10 "0.1.2",
11 "aarch64-unknown-none-softfloat",
12 )
13 .source_dir(Path::new("/home/zhourui/opensource/pie-boot"));
14 builder.output_dir = Some(Path::new(&mf).join("target/tmp"));
15 println!("building..");
16 builder.build().unwrap();
17}pub fn cargo_args<T: AsRef<str>>(self, args: &[T]) -> Self
pub fn cargo_arg<T: AsRef<str>>(self, arg: T) -> Self
Sourcepub fn build(self) -> Result<()>
pub fn build(self) -> Result<()>
Examples found in repository?
examples/run.rs (line 15)
5fn main() {
6 let mf = std::env::var("CARGO_MANIFEST_DIR").unwrap();
7 println!("manifest dir: {mf}");
8 let mut builder = Builder::new(
9 "pie-boot-loader-aarch64",
10 "0.1.2",
11 "aarch64-unknown-none-softfloat",
12 );
13 builder.output_dir = Some(Path::new(&mf).join("target/tmp"));
14 println!("building..");
15 builder.build().unwrap();
16}More examples
examples/run_local.rs (line 16)
5fn main() {
6 let mf = std::env::var("CARGO_MANIFEST_DIR").unwrap();
7 println!("manifest dir: {mf}");
8 let mut builder = Builder::new(
9 "pie-boot-loader-aarch64",
10 "0.1.2",
11 "aarch64-unknown-none-softfloat",
12 )
13 .source_dir(Path::new("/home/zhourui/opensource/pie-boot"));
14 builder.output_dir = Some(Path::new(&mf).join("target/tmp"));
15 println!("building..");
16 builder.build().unwrap();
17}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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