pub struct StubInfo {
pub modules: BTreeMap<String, Module>,
pub python_root: PathBuf,
}
Fields§
§modules: BTreeMap<String, Module>
§python_root: PathBuf
Implementations§
Source§impl StubInfo
impl StubInfo
Sourcepub fn from_pyproject_toml(path: impl AsRef<Path>) -> Result<Self>
pub fn from_pyproject_toml(path: impl AsRef<Path>) -> Result<Self>
Initialize StubInfo from a pyproject.toml
file in CARGO_MANIFEST_DIR
.
This is automatically set up by the crate::define_stub_info_gatherer macro.
Sourcepub fn from_project_root(
default_module_name: String,
project_root: PathBuf,
) -> Result<Self>
pub fn from_project_root( default_module_name: String, project_root: PathBuf, ) -> Result<Self>
Initialize StubInfo with a specific module name and project root.
This must be placed in your PyO3 library crate, i.e. the same crate where inventory::submitted,
not in the gen_stub
executables due to inventory’s mechanism.
pub fn generate(&self) -> Result<()>
Trait Implementations§
impl StructuralPartialEq for StubInfo
Auto Trait Implementations§
impl Freeze for StubInfo
impl RefUnwindSafe for StubInfo
impl Send for StubInfo
impl Sync for StubInfo
impl Unpin for StubInfo
impl UnwindSafe for StubInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more