pub struct AsyncApiRegistry { /* private fields */ }Implementations§
Source§impl AsyncApiRegistry
impl AsyncApiRegistry
pub fn new() -> Self
pub fn load( &mut self, alias: &str, location: &str, base_dir: &Path, ) -> Result<(), String>
pub fn load_from_content( &mut self, alias: &str, content: &str, is_json: bool, ) -> Result<(), String>
pub fn resolve(&self, ext_ref: &ExternalRef) -> Result<&Value, String>
pub fn resolve_ref(&self, alias: &str, pointer: &str) -> Result<&Value, String>
pub fn get_schema_for_path( &self, ext_ref: &ExternalRef, path_segments: &[PathSegment], ) -> Result<Option<Value>, String>
Sourcepub fn resolve_message<'a>(
&'a self,
doc: &EtlDocument,
msg_ref: &MessageRef,
) -> Result<Cow<'a, Value>, String>
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).
Sourcepub fn get_schema_for_message_ref(
&self,
doc: &EtlDocument,
msg_ref: &MessageRef,
path_segments: &[PathSegment],
) -> Result<Option<Value>, String>
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).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AsyncApiRegistry
impl RefUnwindSafe for AsyncApiRegistry
impl Send for AsyncApiRegistry
impl Sync for AsyncApiRegistry
impl Unpin for AsyncApiRegistry
impl UnsafeUnpin for AsyncApiRegistry
impl UnwindSafe for AsyncApiRegistry
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