pub struct Resolver<'a> {
pub components: BTreeMap<String, Value>,
pub gaps: Vec<Gap>,
pub aux_resolved: BTreeSet<String>,
/* private fields */
}Expand description
Fields§
§components: BTreeMap<String, Value>Named schemas, emitted as components/schemas in OpenAPI.
gaps: Vec<Gap>§aux_resolved: BTreeSet<String>Canonical paths walked out of an auxiliary document. Resolved, so deliberately not gaps — reported only to say where they came from.
Implementations§
Source§impl<'a> Resolver<'a>
impl<'a> Resolver<'a>
Sourcepub fn new(
docs: impl Into<Docs<'a>>,
table: &'a TypeTable,
) -> Result<Self, String>
pub fn new( docs: impl Into<Docs<'a>>, table: &'a TypeTable, ) -> Result<Self, String>
Build a resolver over a parsed rustdoc JSON document, or over a
primary document plus its workspace-local companions (Docs).
Sourcepub fn find_type_id(&self, name: &str) -> Option<Value>
pub fn find_type_id(&self, name: &str) -> Option<Value>
Find a struct or enum by its plain name, for attribute overrides that name a type rather than pointing at a signature.
Sourcepub fn find_by_path(&self, canonical: &str) -> Option<&'a Value>
pub fn find_by_path(&self, canonical: &str) -> Option<&'a Value>
Find an item by its fully-qualified path, e.g. app::routes::create.
#[route] records handler ids as module_path!()::fn_name, which is
exactly the path rustdoc reports, so route lookup is a direct match.
Sourcepub fn resolve_by_name(&mut self, name: &str, at: &str) -> Option<Value>
pub fn resolve_by_name(&mut self, name: &str, at: &str) -> Option<Value>
Resolve a struct or enum named in an attribute, searching this crate first and then the workspace-local documents.
Auto Trait Implementations§
impl<'a> Freeze for Resolver<'a>
impl<'a> RefUnwindSafe for Resolver<'a>
impl<'a> Send for Resolver<'a>
impl<'a> Sync for Resolver<'a>
impl<'a> Unpin for Resolver<'a>
impl<'a> UnsafeUnpin for Resolver<'a>
impl<'a> UnwindSafe for Resolver<'a>
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