pub struct Crate { /* private fields */ }Expand description
A reflected crate - the main entry point for type reflection.
Implementationsยง
Sourceยงimpl Crate
impl Crate
Sourcepub fn reflect(crate_name: impl Into<String>) -> Result<Self>
pub fn reflect(crate_name: impl Into<String>) -> Result<Self>
Reflect on a crate by name.
This will connect to the daemon (starting it if needed) and return a handle for querying types in the specified crate.
Sourcepub fn items(&self, pattern: &str) -> Result<Vec<Item>>
pub fn items(&self, pattern: &str) -> Result<Vec<Item>>
Get all items matching a pattern.
Supports:
- Exact:
"foo::Bar" - Wildcard:
"foo::Bar*" - Single-level glob:
"foo::*"(matchesfoo::Barbut notfoo::bar::Baz) - Recursive glob:
"foo::**"(matches all descendants)
Sourcepub fn structs(&self, pattern: &str) -> Result<Vec<StructDef>>
pub fn structs(&self, pattern: &str) -> Result<Vec<StructDef>>
Get all structs matching a pattern.
Sourcepub fn traits(&self, pattern: &str) -> Result<Vec<TraitDef>>
pub fn traits(&self, pattern: &str) -> Result<Vec<TraitDef>>
Get all traits matching a pattern.
Sourcepub fn get_struct(&self, path: &str) -> Result<StructDef>
pub fn get_struct(&self, path: &str) -> Result<StructDef>
Get a specific struct by path.
Sourcepub fn get_type_alias(&self, path: &str) -> Result<TypeAliasDef>
pub fn get_type_alias(&self, path: &str) -> Result<TypeAliasDef>
Get a specific type alias by path.
Auto Trait Implementationsยง
impl Freeze for Crate
impl RefUnwindSafe for Crate
impl Send for Crate
impl Sync for Crate
impl Unpin for Crate
impl UnwindSafe for Crate
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