pub struct Package { /* private fields */ }Expand description
A package in the form of a directory.
Implementations§
Source§impl Package
impl Package
Sourcepub fn to_initialised(
&self,
initialise_options: InitialiseOptions,
) -> Result<InitialisedPackage>
pub fn to_initialised( &self, initialise_options: InitialiseOptions, ) -> Result<InitialisedPackage>
Initialises this package if needed, and returns an InitialisedPackage.
Source§impl Package
impl Package
Sourcepub fn export_distributable(
&self,
options: ExportOptions,
) -> Result<Distributable>
pub fn export_distributable( &self, options: ExportOptions, ) -> Result<Distributable>
Exports the package as a distributable .merlon file.
Source§impl Package
impl Package
Sourcepub fn new<N>(name: N, path: PathBuf) -> Result<Self>where
N: TryIntoName,
pub fn new<N>(name: N, path: PathBuf) -> Result<Self>where
N: TryIntoName,
Create a new package at the given path. The path must not exist.
Source§impl Package
impl Package
Sourcepub fn current() -> Result<Option<Self>>
pub fn current() -> Result<Option<Self>>
Gets the current package, if any, by looking for merlon.toml in the current directory and its parents.
Sourcepub fn readme(&self) -> Result<String>
pub fn readme(&self) -> Result<String>
Returns the text content of the README.md file in the package.
Sourcepub fn manifest(&self) -> Result<Manifest>
pub fn manifest(&self) -> Result<Manifest>
Returns the manifest of the package by parsing the merlon.toml file.
Sourcepub fn uuid_equals(&self, other: &Package) -> Result<bool>
pub fn uuid_equals(&self, other: &Package) -> Result<bool>
Compares two packages by ID.
Sourcepub fn copyright_notice(&self) -> Result<String>
pub fn copyright_notice(&self) -> Result<String>
Returns a copyright notice for this package by reading the package’s LICENSE file.
Trait Implementations§
Source§impl PyClassImpl for Package
impl PyClassImpl for Package
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§type ThreadChecker = ThreadCheckerStub<Package>
type ThreadChecker = ThreadCheckerStub<Package>
This handles following two situations: Read more
type Inventory = Pyo3MethodsInventoryForPackage
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyTypeInfo for Package
impl PyTypeInfo for Package
Source§type AsRefTarget = PyCell<Package>
type AsRefTarget = PyCell<Package>
Utility type to make Py::as_ref work.
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
Source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.
Source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
Checks if
object is an instance of this type or a subclass of this type.Source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
Checks if
object is an instance of this type.Source§impl TryFrom<&Package> for Dependency
impl TryFrom<&Package> for Dependency
Source§impl TryFrom<Package> for InitialisedPackage
impl TryFrom<Package> for InitialisedPackage
impl Eq for Package
Auto Trait Implementations§
impl Freeze for Package
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnsafeUnpin for Package
impl UnwindSafe for Package
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.