Skip to main content

AsyncApiRegistry

Struct AsyncApiRegistry 

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

Implementations§

Source§

impl AsyncApiRegistry

Source

pub fn new() -> Self

Source

pub fn load( &mut self, alias: &str, location: &str, base_dir: &Path, ) -> Result<(), String>

Source

pub fn load_from_content( &mut self, alias: &str, content: &str, is_json: bool, ) -> Result<(), String>

Source

pub fn resolve(&self, ext_ref: &ExternalRef) -> Result<&Value, String>

Source

pub fn resolve_ref(&self, alias: &str, pointer: &str) -> Result<&Value, String>

Source

pub fn get_schema_for_path( &self, ext_ref: &ExternalRef, path_segments: &[PathSegment], ) -> Result<Option<Value>, String>

Source

pub fn resolve_message<'a>( &'a self, doc: &EtlDocument, msg_ref: &MessageRef, ) -> Result<Cow<'a, Value>, String>

Resolve a Message Reference (Section 5.3.4) to its AsyncAPI Message Object-shaped value, regardless of whether it’s an External Reference (delegates to resolve) or an Internal Reference (#/components/messages/<id>, looked up on doc and re-shaped into the same {name, payload, headers} envelope an External Reference would already carry, so callers don’t need to branch on the reference kind).

Source

pub fn get_schema_for_message_ref( &self, doc: &EtlDocument, msg_ref: &MessageRef, path_segments: &[PathSegment], ) -> Result<Option<Value>, String>

Like get_schema_for_path, but accepts either kind of Message Reference (see resolve_message).

Source

pub fn is_path_required( &self, doc: &EtlDocument, msg_ref: &MessageRef, path_segments: &[PathSegment], ) -> Result<Option<bool>, String>

Whether the terminal field of path_segments is listed in its enclosing JSON Schema’s required array — ordinary JSON Schema semantics, used by ECEL’s defined() (spec §6.4.1) to distinguish “always present” (advisory: defined() on it is trivially true) from “may be absent at runtime”. Returns None if the path itself doesn’t resolve at all (a distinct, compile-time-error case — V-208 — handled by the caller via get_schema_for_message_ref returning None, not by this method).

Trait Implementations§

Source§

impl Default for AsyncApiRegistry

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.