pub struct Target {
pub name: Rc<str>,
pub description: Option<Rc<str>>,
pub version: Rc<str>,
pub resource_schemas: Vec<Rc<Schema>>,
pub resource_schema_selector: Rc<str>,
pub effects: BTreeMap<Rc<str>, Rc<Schema>>,
pub resource_schema_lookup: BTreeMap<Value, Rc<Schema>>,
pub default_resource_schema: Option<Rc<Schema>>,
}Available on crate feature
azure_policy only.Expand description
A target defines the domain for which a set of policies are written. It specifies the types of input resources, possible policy effects, and configuration for policy evaluation.
Fields§
§name: Rc<str>Name of the target domain
A Rego module can specify a target by defining a rule named __target__:
target = “my_target”
description: Option<Rc<str>>Description of what this target is for
version: Rc<str>Version of the target
resource_schemas: Vec<Rc<Schema>>Types of input resources that policies can evaluate
resource_schema_selector: Rc<str>The discriminator property that can be used to select a specific resource schema
effects: BTreeMap<Rc<str>, Rc<Schema>>Set of effects that policies can produce
resource_schema_lookup: BTreeMap<Value, Rc<Schema>>Lookup table for resource schemas by discrimiator values.
default_resource_schema: Option<Rc<Schema>>Resource chemas that cannot be distinguished by the discriminator
Implementations§
Source§impl Target
impl Target
pub fn from_json_str(json: &str) -> Result<Self, TargetError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Target
impl<'de> Deserialize<'de> for Target
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnsafeUnpin for Target
impl UnwindSafe for Target
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more