pub struct Bundle {
    pub manifest: Option<Manifest>,
    pub data: Option<Value>,
    pub rego_policies: HashMap<PathBuf, String>,
    pub wasm_policies: Vec<WasmPolicy>,
}
Expand description

An OPA bundle created by opa build.

Fields

manifest: Option<Manifest>

The manifest of the bundle, if any.

data: Option<Value>

The OPA generated data that was bundled during build.

rego_policies: HashMap<PathBuf, String>

All .rego policy files with their respective paths within the bundle.

wasm_policies: Vec<WasmPolicy>

All WASM module policies within the bundle.

A WASM module policy should appear here only if it was listed in the manifest.

Implementations

Load the bundle from a file.

Errors

Errors are returned if the given bundle is invalid or the file operations fail.

Load the bundle from the given bytes.

Bundles are expected to be a .tar.gz format.

Errors

Errors are returned if the bundle is invalid.

Load the bundle from the given reader.

Bundles are expected to be a .tar.gz format.

Errors

Errors are returned if the bundle is invalid or on i/o error.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. 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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.