Struct starlark_dialect_build_targets::EnvironmentContext[][src]

pub struct EnvironmentContext {
    pub default_build_script_target: Option<String>,
    pub build_script_mode: bool,
    // some fields omitted
}

Holds execution context for a Starlark environment.

Fields

default_build_script_target: Option<String>

Name of default target to resolve in build script mode.

build_script_mode: bool

Whether we are operating in Rust build script mode.

This will change the default target to resolve.

Implementations

impl EnvironmentContext[src]

pub fn new(logger: &Logger, cwd: PathBuf) -> Self[src]

pub fn logger(&self) -> &Logger[src]

Obtain a logger for this instance.

pub fn cwd(&self) -> &Path[src]

Obtain the current working directory for this context.

pub fn build_path(&self) -> &Path[src]

Directory to use for the build path.

pub fn set_build_path(&mut self, path: &Path) -> Result<()>[src]

Update the directory to use for the build path.

pub fn set_target_build_path_prefix<P: AsRef<Path>>(
    &mut self,
    prefix: Option<P>
)
[src]

Set the path prefix to use for per-target build paths.

If defined, target build paths are of the form <build_path>/<prefix>/<target>. Otherwise they are <build_path>/<target>.

pub fn target_build_path(&self, target: &str) -> PathBuf[src]

Obtain the directory to use to build a named target.

pub fn targets(&self) -> &BTreeMap<String, Target>[src]

Obtain all registered targets.

pub fn default_target(&self) -> Option<&str>[src]

Obtain the default target to resolve.

pub fn get_target(&self, target: &str) -> Option<&Target>[src]

Obtain a named target.

pub fn get_target_mut(&mut self, target: &str) -> Option<&mut Target>[src]

Obtain a mutable named target.

pub fn set_resolve_targets(&mut self, targets: Vec<String>)[src]

Set the list of targets to resolve.

pub fn targets_order(&self) -> &Vec<String>[src]

Obtain the order that targets were registered in.

pub fn register_target(
    &mut self,
    target: String,
    callable: Value,
    depends: Vec<String>,
    default: bool,
    default_build_script: bool
)
[src]

Register a named target.

pub fn targets_to_resolve(&self) -> Vec<String>[src]

Determine what targets should be resolved.

This isn’t the full list of targets that will be resolved, only the main targets that we will instruct the resolver to resolve.

Trait Implementations

impl Debug for EnvironmentContext[src]

impl TypedValue for EnvironmentContext[src]

type Holder = Mutable<EnvironmentContext>

Must be either MutableHolder<Self> or ImmutableHolder<Self>

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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.

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.