Struct starlark_dialect_build_targets::EnvironmentContext [−][src]
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]
&mut self,
prefix: Option<P>
)
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]
&mut self,
target: String,
callable: Value,
depends: Vec<String>,
default: bool,
default_build_script: bool
)
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>
const TYPE: &'static str
[src]
fn values_for_descendant_check_and_freeze(
&self
) -> Box<dyn Iterator<Item = Value>>
[src]
&self
) -> Box<dyn Iterator<Item = Value>>
pub fn function_id(&self) -> Option<FunctionId>
[src]
pub fn to_str(&self) -> String
[src]
pub fn to_str_impl(&self, buf: &mut String) -> Result<(), Error>
[src]
pub fn to_repr(&self) -> String
[src]
pub fn to_repr_impl(&self, buf: &mut String) -> Result<(), Error>
[src]
pub fn to_bool(&self) -> bool
[src]
pub fn to_int(&self) -> Result<i64, ValueError>
[src]
pub fn get_hash(&self) -> Result<u64, ValueError>
[src]
pub fn equals(&self, other: &Self) -> Result<bool, ValueError>
[src]
pub fn compare(&self, _other: &Self) -> Result<Ordering, ValueError>
[src]
pub fn call(
&self,
_call_stack: &mut CallStack,
_type_values: &TypeValues,
_positional: Vec<Value, Global>,
_named: LinkedHashMap<RcString, Value, RandomState>,
_args: Option<Value>,
_kwargs: Option<Value>
) -> Result<Value, ValueError>
[src]
&self,
_call_stack: &mut CallStack,
_type_values: &TypeValues,
_positional: Vec<Value, Global>,
_named: LinkedHashMap<RcString, Value, RandomState>,
_args: Option<Value>,
_kwargs: Option<Value>
) -> Result<Value, ValueError>
pub fn at(&self, index: Value) -> Result<Value, ValueError>
[src]
pub fn set_at(
&mut self,
index: Value,
_new_value: Value
) -> Result<(), ValueError>
[src]
&mut self,
index: Value,
_new_value: Value
) -> Result<(), ValueError>
pub fn slice(
&self,
_start: Option<Value>,
_stop: Option<Value>,
_stride: Option<Value>
) -> Result<Value, ValueError>
[src]
&self,
_start: Option<Value>,
_stop: Option<Value>,
_stride: Option<Value>
) -> Result<Value, ValueError>
pub fn iter(&self) -> Result<&(dyn TypedIterable + 'static), ValueError>
[src]
pub fn length(&self) -> Result<i64, ValueError>
[src]
pub fn get_attr(&self, attribute: &str) -> Result<Value, ValueError>
[src]
pub fn has_attr(&self, _attribute: &str) -> Result<bool, ValueError>
[src]
pub fn set_attr(
&mut self,
attribute: &str,
_new_value: Value
) -> Result<(), ValueError>
[src]
&mut self,
attribute: &str,
_new_value: Value
) -> Result<(), ValueError>
pub fn dir_attr(&self) -> Result<Vec<RcString, Global>, ValueError>
[src]
pub fn contains(&self, other: &Value) -> Result<bool, ValueError>
[src]
pub fn plus(&self) -> Result<Self, ValueError>
[src]
pub fn minus(&self) -> Result<Self, ValueError>
[src]
pub fn add(&self, _other: &Self) -> Result<Self, ValueError>
[src]
pub fn sub(&self, _other: &Self) -> Result<Self, ValueError>
[src]
pub fn mul(&self, other: Value) -> Result<Value, ValueError>
[src]
pub fn percent(&self, other: Value) -> Result<Value, ValueError>
[src]
pub fn div(&self, other: Value) -> Result<Value, ValueError>
[src]
pub fn floor_div(&self, other: Value) -> Result<Value, ValueError>
[src]
pub fn pipe(&self, other: Value) -> Result<Value, ValueError>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for EnvironmentContext
impl !Send for EnvironmentContext
impl !Sync for EnvironmentContext
impl Unpin for EnvironmentContext
impl !UnwindSafe for EnvironmentContext
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,