pub struct CrateExtraReader { /* private fields */ }Expand description
Builder for reading CrateExtra data from a crate’s source directory.
Allows selective reading of README files and examples.
Implementations§
Source§impl CrateExtraReader
impl CrateExtraReader
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new CrateExtraReader with default settings, which will
attempt to read the main README file and examples from the examples/ directory.
Sourcepub fn no_readme(self) -> Self
pub fn no_readme(self) -> Self
Disables reading of the crate’s main README file (README.md or README).
Sourcepub fn no_examples(self) -> Self
pub fn no_examples(self) -> Self
Disables reading of example files from the examples/ directory and its README.
Sourcepub fn read(
&self,
manifest: &CargoManifest,
package_dir: &FilePath,
) -> Result<CrateExtra>
pub fn read( &self, manifest: &CargoManifest, package_dir: &FilePath, ) -> Result<CrateExtra>
Reads the extra crate information from the specified crate source directory.
§Arguments
manifest: A reference to the parsedCargo.tomlof the package.package_dir: The path to the root directory of the package.
§Returns
A Result containing the CrateExtra data, or an error if reading fails.
Trait Implementations§
Source§impl Debug for CrateExtraReader
impl Debug for CrateExtraReader
Source§impl Default for CrateExtraReader
impl Default for CrateExtraReader
Source§fn default() -> CrateExtraReader
fn default() -> CrateExtraReader
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CrateExtraReader
impl RefUnwindSafe for CrateExtraReader
impl Send for CrateExtraReader
impl Sync for CrateExtraReader
impl Unpin for CrateExtraReader
impl UnwindSafe for CrateExtraReader
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