Struct seacan::bin::Compiler[][src]

pub struct Compiler { /* fields omitted */ }
Expand description

Compile a binary

let artifact = Compiler::bin("hello_world")
    .workspace("samples/hello_world")
    .features(FeatureSpec::new(vec!["non_default_feature".into()]))
    .release(true)
    .compile()?;

Implementations

impl Compiler[src]

#[must_use]
pub fn bin(name: impl Into<String>) -> Self
[src]

Compile a binary.

Note: By default the default binary has the name of the crate.

#[must_use]
pub fn example(name: impl Into<String>) -> Self
[src]

Compile an example.

pub fn workspace(&mut self, path: impl Into<PathBuf>) -> &mut Self[src]

The directory to run cargo in.

By default the current working directory.

pub fn package(&mut self, package: PackageSpec) -> &mut Self[src]

The package the binary is in.

By default PackageSpec::Any.

pub fn on_compiler_msg(
    &mut self,
    cb: impl FnMut(CompilerMessage) + 'static
) -> &mut Self
[src]

Callback for compiler messages.

Regardless of if you specify this compiler messages will be logged at debug level using tracing.

pub fn target_dir(&mut self, target_dir: impl Into<Utf8PathBuf>) -> &mut Self[src]

Where to put the build artifacts.

By default this is whatever cargo chooses by default.

pub fn features(&mut self, features: FeatureSpec) -> &mut Self[src]

Enable or disable feature flags.

By default this is whatever cargo chooses by default.

pub fn release(&mut self, is_release: bool) -> &mut Self[src]

If we should build in release mode.

pub fn compile(&mut self) -> Result<ExecutableArtifact, BuildError>[src]

Compile the described executable

Trait Implementations

impl Debug for Compiler[src]

fn fmt(&self, __f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl !RefUnwindSafe for Compiler

impl !Send for Compiler

impl !Sync for Compiler

impl Unpin for Compiler

impl !UnwindSafe for Compiler

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.