pub struct EnvironmentContext {
    pub default_build_script_target: Option<String>,
    pub build_script_mode: bool,
    /* private fields */
}
Expand description

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§

Obtain the current working directory for this context.

Directory to use for the build path.

Update the directory to use for the build path.

Resolve an absolute filesystem path from a path input.

If the incoming path is absolute, it is returned. Otherwise relative paths are joined with the current build path.

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>.

Obtain the directory to use to build a named target.

Obtain all registered targets.

Obtain the default target to resolve.

Obtain a named target.

Obtain a mutable named target.

Set the list of targets to resolve.

Obtain the order that targets were registered in.

Register a named target.

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§

Formats the value using the given formatter. Read more
Must be either MutableHolder<Self> or ImmutableHolder<Self>
Return a string describing the type of self, as returned by the type() function.
Return a list of values to be used in freeze or descendant check operations. Read more
Return function id to detect recursion. Read more
Return a string describing of self, as returned by the str() function.
The implementation of to_str, more efficient for nested objects
Return a string representation of self, as returned by the repr() function.
The implementation of to_repr, more efficient for nested objects
Convert self to a Boolean truth value, as returned by the bool() function.
Convert self to a integer value, as returned by the int() function if the type is numeric (not for string).
Return a hash code for self, as returned by the hash() function, or OperationNotSupported if there is no hash for this value (e.g. list).
Compare self with other for equality. Read more
Compare self with other. Read more
Perform a call on the object, only meaningfull for function object. Read more
Perform an array or dictionary indirection. Read more
Set the value at index with new_value. Read more
Extract a slice of the underlying object if the object is indexable. The result will be object between start and stop (both of them are added length() if negative and then clamped between 0 and length()). stride indicates the direction. Read more
Returns an iterable over the value of this container if this value hold an iterable container.
Returns the length of the value, if this value is a sequence.
Get an attribute for the current value as would be returned by dotted expression (i.e. a.attribute). Read more
Return true if an attribute of name attribute exists for the current value. Read more
Set the attribute named attribute of the current value to new_value (e.g. a.attribute = new_value). Read more
Return a vector of string listing all attribute of the current value, excluding native methods.
Tell wether other is in the current value, if it is a container. Read more
Apply the + unary operator to the current value. Read more
Apply the - unary operator to the current value. Read more
Add other to the current value. Read more
Substract other from the current value. Read more
Multiply the current value with other. Read more
Apply the percent operator between the current value and other. Read more
Divide the current value with other. division. Read more
Floor division between the current value and other. Read more
Apply the operator pipe to the current value and other. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.