pub struct CargoConfigGenerator { /* private fields */ }Expand description
Generates a .cargo/config.toml for cross-compilation.
Implementations§
Source§impl CargoConfigGenerator
impl CargoConfigGenerator
Sourcepub fn new(target: TargetTriple, workspace_root: PathBuf) -> Self
pub fn new(target: TargetTriple, workspace_root: PathBuf) -> Self
Creates a new generator for the given target.
Sourcepub fn with_linker(
self,
linker_path: impl Into<PathBuf>,
flavor: &str,
args: Vec<String>,
) -> Self
pub fn with_linker( self, linker_path: impl Into<PathBuf>, flavor: &str, args: Vec<String>, ) -> Self
Sets the linker for the target.
Sourcepub fn with_runner(self, runner: impl Into<String>) -> Self
pub fn with_runner(self, runner: impl Into<String>) -> Self
Sets the runner for the target (for running tests).
Sourcepub fn with_rustflags(self, flags: Vec<String>) -> Self
pub fn with_rustflags(self, flags: Vec<String>) -> Self
Sets custom rustflags for the target.
Sourcepub fn with_env(self, env: BTreeMap<String, String>) -> Self
pub fn with_env(self, env: BTreeMap<String, String>) -> Self
Sets environment variables for the target.
Sourcepub fn with_sysroot(self, sysroot: impl Into<PathBuf>) -> Self
pub fn with_sysroot(self, sysroot: impl Into<PathBuf>) -> Self
Sets the sysroot for the target.
Sourcepub fn with_custom_section(self, key: String, value: Value) -> Self
pub fn with_custom_section(self, key: String, value: Value) -> Self
Adds a custom [target.xxx] section.
Sourcepub fn with_build_target(self, target: &TargetTriple) -> Self
pub fn with_build_target(self, target: &TargetTriple) -> Self
Sets the build target.
Sourcepub fn write(self) -> Result<PathBuf, CrossBuildError>
pub fn write(self) -> Result<PathBuf, CrossBuildError>
Writes the config to .cargo/config.toml in the workspace root.
Auto Trait Implementations§
impl Freeze for CargoConfigGenerator
impl RefUnwindSafe for CargoConfigGenerator
impl Send for CargoConfigGenerator
impl Sync for CargoConfigGenerator
impl Unpin for CargoConfigGenerator
impl UnsafeUnpin for CargoConfigGenerator
impl UnwindSafe for CargoConfigGenerator
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more