support sandboxed rust rules
This commit adds support for compiling rust rules inside the sbox sandbox. To compile a rust module with sandboxing enabled, the entry point to the crate must be specified via the `crate_root` property, and all input sources and compile-time data must be specified via the `srcs` and `compile_data` properties. Bug: 286077158 Change-Id: I8c9dc5cf7578037a583b4be2e2f73cf20ffd4408
This commit is contained in:
@@ -95,6 +95,12 @@ func NewDepSet[T depSettableType](order DepSetOrder, direct []T, transitive []*D
|
||||
}
|
||||
}
|
||||
|
||||
// AddDirectToDepSet returns a new DepSet with additional elements added to its direct set.
|
||||
// The transitive sets remain untouched.
|
||||
func AddDirectToDepSet[T depSettableType](d *DepSet[T], direct ...T) *DepSet[T] {
|
||||
return NewDepSet[T](d.order, Concat(d.direct, direct), d.transitive)
|
||||
}
|
||||
|
||||
// DepSetBuilder is used to create an immutable DepSet.
|
||||
type DepSetBuilder[T depSettableType] struct {
|
||||
order DepSetOrder
|
||||
@@ -188,3 +194,14 @@ func (d *DepSet[T]) ToList() []T {
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
// ToListDirect returns the direct elements of a DepSet flattened to a list.
|
||||
func (d *DepSet[T]) ToListDirect() []T {
|
||||
if d == nil {
|
||||
return nil
|
||||
}
|
||||
list := make([]T, len(d.direct))
|
||||
copy(list, d.direct)
|
||||
list = firstUniqueInPlace(list)
|
||||
return list
|
||||
}
|
||||
|
Reference in New Issue
Block a user