pub struct CargoProject { /* private fields */ }Expand description
Temporary Cargo project for compilation.
Creates a temporary directory with Cargo.toml and src/lib.rs for compiling code with external dependencies.
Implementations§
Source§impl CargoProject
impl CargoProject
Sourcepub fn edition(self, edition: RustEdition) -> Self
pub fn edition(self, edition: RustEdition) -> Self
Set the Rust edition.
Sourcepub fn dependency(self, name: &str, version: &str) -> Self
pub fn dependency(self, name: &str, version: &str) -> Self
Add a dependency.
Sourcepub fn dependencies(&self) -> &[(String, String)]
pub fn dependencies(&self) -> &[(String, String)]
Get dependencies.
Sourcepub fn manifest_path(&self) -> Option<&PathBuf>
pub fn manifest_path(&self) -> Option<&PathBuf>
Get manifest path.
Sourcepub fn project_dir(&self) -> Option<&PathBuf>
pub fn project_dir(&self) -> Option<&PathBuf>
Get project directory.
Sourcepub fn write_to_temp(self) -> CITLResult<Self>
pub fn write_to_temp(self) -> CITLResult<Self>
Write project to a temporary directory.
§Errors
Returns error if directory creation or file writing fails.
Trait Implementations§
Source§impl Debug for CargoProject
impl Debug for CargoProject
Auto Trait Implementations§
impl Freeze for CargoProject
impl RefUnwindSafe for CargoProject
impl Send for CargoProject
impl Sync for CargoProject
impl Unpin for CargoProject
impl UnwindSafe for CargoProject
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> 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