Skip to main content

CompiledSchemaStore

Struct CompiledSchemaStore 

Source
pub struct CompiledSchemaStore { /* private fields */ }

Implementations§

Source§

impl CompiledSchemaStore

Source

pub fn new() -> Self

Source

pub fn load_region_data(&mut self, json_bytes: &[u8]) -> Result<(), String>

Source

pub fn get(&self, type_name: &str) -> Option<&CompiledSchema>

Source

pub fn type_names(&self) -> impl Iterator<Item = &str>

Source

pub fn apply_overlay( &mut self, type_name: &str, raw: &Value, ) -> Result<OverlayOutcome, SchemaOverlayError>

Merge an overlay CloudFormation resource provider schema (raw registry JSON) into the store under type_name.

The raw schema is compiled with the same transformation used at build time and deep-merged into the bundled schema for that type; when no bundled schema exists, the compiled overlay is registered as a new type. The return value says which happened, so callers can report a type_name that matched nothing. See the crate::overlay module for the merge model and its scope limits.

Input is validated before anything is committed - an empty type name, non-object JSON, nesting past MAX_OVERLAY_DEPTH, a cyclic definition graph, or an overlay that would change nothing is an error and leaves the store untouched. The merge therefore runs on a copy of the bundled schema that is only installed once it validates; a partly merged schema is never observable.

Source

pub fn len(&self) -> usize

Source

pub fn is_available_in_region(&self, type_name: &str, region: &str) -> bool

Source

pub fn is_known_in_any_region(&self, type_name: &str) -> bool

Whether the type appears in at least one region’s availability map. Used to distinguish a genuine regional provider type (absent only in some regions) from a type that is region-agnostic or not a provider type at all (SAM/transform placeholders), which must not trigger the region check.

Source

pub fn has_region_data(&self) -> bool

Source

pub fn ref_types(&self) -> &RefTypeStore

Source

pub fn lifecycle(&self) -> &LifecycleStore

Source

pub fn extensions(&self) -> &ExtensionStore

Source

pub fn region_enums(&self) -> &RegionEnumStore

Trait Implementations§

Source§

impl Default for CompiledSchemaStore

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.