Struct Workspace

Source
pub struct Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,
{ /* private fields */ }

Implementations§

Source§

impl<P, H> Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source

pub fn path_mut(&mut self) -> &mut P

Source

pub fn crates_mut(&mut self) -> &mut Vec<Arc<Mutex<H>>>

Source§

impl<P, H> Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source

pub fn path(&self) -> &P

Source

pub fn crates(&self) -> &Vec<Arc<Mutex<H>>>

Trait Implementations§

Source§

impl<P, H> AddInternalDependency<P, H> for Workspace<P, H>
where P: for<'async_trait> Debug + for<'async_trait> Clone + for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: CrateHandleInterface<P> + Debug + Send + Sync,

Source§

type Error = WorkspaceError

Source§

fn add_internal_dependency<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, target_crate: &'life1 H, dep_crate: &'life2 H, ) -> Pin<Box<dyn Future<Output = Result<(), WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Workspace<P, H>: 'async_trait,

Attempt to add a dependency on dep_crate to the target_crate. Read more
Source§

impl<P, H> AddToWorkspaceMembers<P> for Workspace<P, H>
where P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + for<'async_trait> Clone + 'static, H: CrateHandleInterface<P> + Send + Sync + 'static,

Source§

fn add_to_workspace_members<'life0, 'life1, 'async_trait>( &'life0 self, new_crate_path: &'life1 P, ) -> Pin<Box<dyn Future<Output = Result<(), WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> Analyze for Workspace<P, H>
where P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: for<'async_trait> CrateHandleInterface<P> + for<'async_trait> HasTestsDirectory + for<'async_trait> GetTestFiles + for<'async_trait> GetSourceFilesWithExclusions + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Here we implement Analyze for Workspace<P, H>. Notice that each crate is Arc<Mutex<H>>. Now that we have “passthrough” impls (see below), Arc<Mutex<H>> will satisfy HasTestsDirectory + GetTestFiles + GetSourceFilesWithExclusions.

Source§

type Analysis = WorkspaceSizeAnalysis

Source§

type Error = WorkspaceError

Source§

fn analyze<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<<Workspace<P, H> as Analyze>::Analysis, <Workspace<P, H> as Analyze>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> AsRef<Path> for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn as_ref(&self) -> &Path

Allows Workspace to be treated as a path

Source§

impl<P, H> AsyncFindItems for Workspace<P, H>
where P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: CrateHandleInterface<P> + Send + Sync,

Source§

fn find_items<'life0, 'async_trait>( path: &'life0 Path, ) -> Pin<Box<dyn Future<Output = Result<Vec<<Workspace<P, H> as AsyncFindItems>::Item>, <Workspace<P, H> as AsyncFindItems>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Asynchronously finds all the crates in the workspace

Source§

type Item = Arc<Mutex<H>>

Source§

type Error = WorkspaceError

Source§

impl<P, H> AsyncPathValidator for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn is_valid<'life0, 'async_trait>( path: &'life0 Path, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where 'life0: 'async_trait,

Asynchronously checks if the path is a valid Rust workspace

Source§

impl<P, H> AsyncTryFrom<P> for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Clone + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn new<'life0, 'async_trait>( path: &'life0 P, ) -> Pin<Box<dyn Future<Output = Result<Workspace<P, H>, <Workspace<P, H> as AsyncTryFrom<P>>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Asynchronously initializes a new workspace at the provided path, ensuring there’s a [workspace] table in Cargo.toml. If not found, returns WorkspaceError::ActuallyInSingleCrate.

Source§

type Error = WorkspaceError

Source§

impl<P, H> BasicTopologicalSort for Workspace<P, H>
where P: for<'a> From<PathBuf> + for<'a> AsRef<Path> + for<'a> Send + for<'a> Sync + 'a, H: for<'a> CrateHandleInterface<P> + for<'a> Send + for<'a> Sync + 'static, Workspace<P, H>: GenerateDependencyTree<Tree = Graph<String, ()>, Error = WorkspaceError>,

Source§

fn topological_order_crate_names<'life0, 'life1, 'async_trait>( &'life0 self, config: &'life1 TopologicalSortConfig, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> BuildWorkspaceSubTree for Workspace<P, H>
where P: From<PathBuf> + AsRef<Path> + Clone + Send + Sync + 'static, H: CrateHandleInterface<P> + Send + Sync + 'static,

Source§

fn build_workspace_subtree<'life0, 'life1, 'async_trait>( &'life0 self, crate_name: &'life1 str, levels: usize, verbose: bool, ) -> Pin<Box<dyn Future<Output = Result<WorkspaceDependencyTree, WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Workspace<P, H>: 'async_trait,

Builds a tree focusing on a single crate as the “root” (entrypoint), recursing down its dependencies up to levels.

Source§

impl<P, H> BuildWorkspaceTree for Workspace<P, H>
where P: From<PathBuf> + AsRef<Path> + Send + Sync + 'static, H: CrateHandleInterface<P> + Send + Sync + 'static,

Source§

fn build_workspace_tree<'life0, 'async_trait>( &'life0 self, levels: usize, verbose: bool, ) -> Pin<Box<dyn Future<Output = Result<WorkspaceDependencyTree, WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Build the workspace dependency tree up to levels levels deep, optionally toggling “verbose,” or ignoring it as desired.
Source§

impl<P, T> BumpAll for Workspace<P, T>
where Workspace<P, T>: WorkspaceInterface<P, T> + Send + Sync, P: for<'any> From<PathBuf> + for<'any> AsRef<Path> + for<'any> Send + for<'any> Sync + for<'any> Clone + 'any, T: for<'any> CrateHandleInterface<P> + for<'any> Bump<Error = CrateError> + for<'any> Send + for<'any> Sync + for<'any> Clone + 'any,

Source§

type Error = WorkspaceError

Source§

fn bump_all<'life0, 'async_trait>( &'life0 mut self, release: ReleaseType, ) -> Pin<Box<dyn Future<Output = Result<(), <Workspace<P, T> as BumpAll>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, T>: 'async_trait,

Bump all crates in the workspace by the specified release type.
Source§

impl<P, H> BumpCrateAndDownstreams for Workspace<P, H>
where P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: CrateHandleInterface<P> + Bump<Error = CrateError> + Send + Sync,

Source§

type Error = WorkspaceError

Source§

fn bump_crate_and_downstreams<'life0, 'life1, 'async_trait>( &'life0 mut self, crate_handle: &'life1 mut CrateHandle, release: ReleaseType, ) -> Pin<Box<dyn Future<Output = Result<(), <Workspace<P, H> as BumpCrateAndDownstreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Workspace<P, H>: 'async_trait,

Bump a single crate and any crates that depend on it. Then rewrite their Cargo.toml references so they point at the newly bumped version.
Source§

impl<P, H> CleanupWorkspace for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn cleanup_workspace<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Asynchronously cleans up unnecessary files and directories in the workspace.

Source§

impl<P, H> CreateCrateSkeleton<P> for Workspace<P, H>
where P: From<PathBuf> + AsRef<Path> + Clone + Send + Sync + 'static, H: CrateHandleInterface<P> + Send + Sync + 'static,

Source§

fn create_new_crate_skeleton<'life0, 'life1, 'async_trait>( &'life0 self, new_crate_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<P, WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> Debug for Workspace<P, H>
where P: Debug + for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: Debug + CrateHandleInterface<P>,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<P, H> DetectCircularDependencies for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn detect_circular_dependencies<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Detects circular dependencies in the workspace by leveraging cargo metadata.

Source§

type Error = WorkspaceError

Source§

impl<P, H> EnsureAllSourceFilesAreRegistered for Workspace<P, H>
where P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Clone + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: CrateHandleInterface<P> + EnsureAllSourceFilesAreRegistered<Error = SourceFileRegistrationError> + Send + Sync,

Source§

type Error = SourceFileRegistrationError

Source§

fn ensure_all_source_files_are_registered<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), <Workspace<P, H> as EnsureAllSourceFilesAreRegistered>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> EnsureGitClean for Workspace<P, H>
where P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Clone + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: CrateHandleInterface<P> + Send + Sync,

Source§

fn ensure_git_clean<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), <Workspace<P, H> as EnsureGitClean>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Checks that the Git working directory is clean:

  • If git status --porcelain returns any output, we fail.
  • If there’s no .git folder or git isn’t installed, this will also error out.
Source§

type Error = GitError

Source§

impl<P, H> FindCrateByName<P, H> for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn find_crate_by_name<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<Arc<Mutex<H>>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> FocusCrateTopologicalSort for Workspace<P, H>
where P: for<'a> From<PathBuf> + for<'a> AsRef<Path> + for<'a> Send + for<'a> Sync + 'a, H: for<'a> CrateHandleInterface<P> + for<'a> Send + for<'a> Sync + 'static, Workspace<P, H>: GenerateDependencyTree<Tree = Graph<String, ()>, Error = WorkspaceError>,

Source§

fn topological_order_upto_crate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, config: &'life1 TopologicalSortConfig, focus_crate_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

fn layered_topological_order_upto_crate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, config: &'life1 TopologicalSortConfig, focus_crate_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<String>>, WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> GenerateDependencyTree for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn generate_dependency_tree<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Graph<String, ()>, WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Generates a dependency tree for all crates in the workspace.

Source§

fn generate_dependency_tree_dot<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Generates the dependency tree and returns it in DOT format.

Source§

type Tree = Graph<String, ()>

Source§

type Error = WorkspaceError

Source§

impl<P, H> GenerateDocs for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn generate_docs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Generates the documentation for the entire workspace by running cargo doc.

Source§

type Error = WorkspaceError

Source§

impl<P, H> GetAllCrateNames for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn get_all_crate_names<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> GetCargoMetadata for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

  1. Implement GetCargoMetadata for your Workspace (already done):
Source§

fn get_cargo_metadata<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Metadata, <Workspace<P, H> as GetCargoMetadata>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

We run cargo metadata from the workspace root directory

Source§

type Error = WorkspaceError

Source§

impl<P, H> GetCrates<P, H> for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn crates(&self) -> &[Arc<Mutex<H>>]

Source§

impl<P, H> GetCratesMut<P, H> for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn crates_mut(&mut self) -> &mut Vec<Arc<Mutex<H>>>

Source§

impl<'a, P, H> IntoIterator for &'a Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

type Item = &'a Arc<Mutex<H>>

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, Arc<Mutex<H>>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <&'a Workspace<P, H> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<P, H> LayeredTopologicalSort for Workspace<P, H>
where P: for<'a> From<PathBuf> + for<'a> AsRef<Path> + for<'a> Send + for<'a> Sync + 'a, H: for<'a> CrateHandleInterface<P> + for<'a> Send + for<'a> Sync + 'static, Workspace<P, H>: GenerateDependencyTree<Tree = Graph<String, ()>, Error = WorkspaceError>,

Source§

fn layered_topological_order_crate_names<'life0, 'life1, 'async_trait>( &'life0 self, config: &'life1 TopologicalSortConfig, ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<String>>, WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> NameAllFiles for Workspace<P, H>
where P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Clone + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: NameAllFiles<Error = CrateError> + CrateHandleInterface<P> + Send + Sync,

Source§

type Error = WorkspaceError

Source§

fn name_all_files<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), <Workspace<P, H> as NameAllFiles>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Remove old // ------ [ File: ... ] lines and prepend a new one naming each .rs file in either a single crate or an entire workspace.
Source§

impl<P, H> NumCrates for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn n_crates(&self) -> usize

Source§

impl<P, H> PinAllWildcardDependencies for Workspace<P, H>
where P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Clone + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: for<'async_trait> CrateHandleInterface<P, Error = CrateError> + for<'async_trait> PinWildcardDependencies<Error = CrateError> + for<'async_trait> AsyncTryFrom<PathBuf> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

type Error = WorkspaceError

Source§

fn pin_all_wildcard_dependencies<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), <Workspace<P, H> as PinAllWildcardDependencies>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> PruneInvalidCategorySlugsFromSubstructures for Workspace<P, H>
where P: From<PathBuf> + AsRef<Path> + Send + Sync + 'static, H: CrateHandleInterface<P> + PruneInvalidCategorySlugs<Error = CrateError> + Send + Sync + 'static,

Source§

type Error = WorkspaceError

Source§

fn prune_invalid_category_slugs_from_members<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<usize, <Workspace<P, H> as PruneInvalidCategorySlugsFromSubstructures>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Prunes category slugs in each of this workspace’s crates. Returns total removed across all members.
Source§

impl<P, H> ReadyForCargoPublish for Workspace<P, H>
where H: CrateHandleInterface<P> + ReadyForCargoPublish<Error = CrateError>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn ready_for_cargo_publish<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Ensures all crates in the workspace are ready for Cargo publishing

Source§

type Error = WorkspaceError

Source§

impl<P, H> RebuildOrTest for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

type Error = WorkspaceError

Source§

fn rebuild_or_test<'life0, 'life1, 'async_trait>( &'life0 self, runner: &'life1 dyn CommandRunner, ) -> Pin<Box<dyn Future<Output = Result<(), <Workspace<P, H> as RebuildOrTest>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> RegisterInPrefixGroup<P, H> for Workspace<P, H>
where P: for<'async_trait> Debug + for<'async_trait> Clone + for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: CrateHandleInterface<P> + Send + Sync + Debug + Clone,

Source§

fn register_in_prefix_crate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, prefix_crate: &'life1 H, new_crate: &'life2 H, ) -> Pin<Box<dyn Future<Output = Result<(), <Workspace<P, H> as RegisterInPrefixGroup<P, H>>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Workspace<P, H>: 'async_trait,

Registers new_crate into the specified prefix_crate by:

  1. Adding a path-based dependency in prefix_crate’s Cargo.toml under [dependencies] new_crate = { path="..." }
  2. Inserting a pub use new_crate_identifier::*; line in prefix_crate’s src/lib.rs (Only if such a line doesn’t already exist).
  • “new_crate_identifier” is typically the crate’s name with - replaced by _, e.g. “batch-mode-batch-schema” => “batch_mode_batch_schema”.
§Steps:
  • Compute the relative path from prefix_crate to new_crate for Cargo.toml
  • Load prefix_crate’s Cargo.toml via toml_edit and insert dependency
  • Write updated Cargo.toml
  • Append (if not already present) a pub use <new_crate_identifier>::*; in prefix_crate’s src/lib.rs
Source§

type Error = WorkspaceError

Source§

impl<P, H> RunLinting for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Implementation for the entire workspace. (unchanged from your original approach).

Source§

type Report = LintReport

Source§

type Error = LintingError

Source§

fn run_linting<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<<Workspace<P, H> as RunLinting>::Report, <Workspace<P, H> as RunLinting>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> RunTestsWithCoverage for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn run_tests_with_coverage<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<<Workspace<P, H> as RunTestsWithCoverage>::Report, <Workspace<P, H> as RunTestsWithCoverage>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Runs tests and gathers code coverage.

Source§

type Report = TestCoverageReport

Source§

type Error = WorkspaceError

Source§

impl<P, H> ScanPrefixGroups<P, H> for Workspace<P, H>
where P: for<'async_trait> Debug + for<'async_trait> Clone + for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: CrateHandleInterface<P> + Send + Sync + Debug + Clone,

Source§

fn scan<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<PrefixGroup<P, H>>, <Workspace<P, H> as ScanPrefixGroups<P, H>>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Identifies prefix groups using the “longest facade” logic:

  1. First, we lock each Arc<AsyncMutex<H>> to retrieve its name (as String) and store (name, arc_handle) pairs in a local vector.
  2. Sort these pairs by descending name length (so “batch-mode-extra” is processed before “batch-mode”).
  3. For each pair (facade_name, facade_arc), if not yet assigned to a group, gather all (other_name, other_arc) whose names match facade_name or start with "facade_name-".
  4. If we get fewer than 2 matches, no group is formed. Otherwise, we form a PrefixGroup whose prefix = facade_name, optionally set prefix_crate = Some(Arc<H>) for the one whose name is exactly facade_name, and three_p_crate = Some(Arc<H>) for the one whose name is facade_name-3p, with the rest in member_crates.
  5. We store them as Arc<H> (not Arc<AsyncMutex<H>>) by locking each handle and cloning the inner H. This ensures the PrefixGroup holds a “snapshot” of each crate handle rather than a locked mutex.
  6. Mark all involved crates as assigned. Repeat until all pairs are processed.
Source§

type Error = WorkspaceError

Source§

impl<P, H> ShowAll for Workspace<P, H>
where P: for<'a> From<PathBuf> + for<'a> AsRef<Path> + for<'a> Clone + for<'a> Send + for<'a> Sync + 'a, H: for<'a> CrateHandleInterface<P> + for<'a> ShowItem<Error = CrateError> + for<'a> Send + for<'a> Sync + 'a,

Source§

type Error = WorkspaceError

Source§

fn show_all<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 ShowFlags, ) -> Pin<Box<dyn Future<Output = Result<String, <Workspace<P, H> as ShowAll>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> SortAndFormatImports for Workspace<P, H>
where P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Clone + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: CrateHandleInterface<P> + SortAndFormatImports<Error = CrateError> + Send + Sync,

Source§

type Error = WorkspaceError

Source§

fn sort_and_format_imports<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), <Workspace<P, H> as SortAndFormatImports>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Sorts & formats the imports for either a single crate or an entire workspace.
Source§

impl<P, H> TryPublish for Workspace<P, H>
where P: From<PathBuf> + AsRef<Path> + Send + Sync + 'static, H: TryPublish<Error = CrateError> + CrateHandleInterface<P> + Send + Sync + 'static,

Source§

type Error = WorkspaceError

Source§

fn try_publish<'life0, 'async_trait>( &'life0 self, dry_run: bool, ) -> Pin<Box<dyn Future<Output = Result<(), <Workspace<P, H> as TryPublish>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> TryPublishCrateTree<P, H> for Workspace<P, H>
where P: From<PathBuf> + AsRef<Path> + Send + Sync + 'static, H: TryPublish<Error = CrateError> + CrateHandleInterface<P, Error = CrateError> + IsPrivate + Send + Sync + 'static,

Source§

fn try_publish_crate_tree<'life0, 'life1, 'async_trait>( &'life0 self, root_crate_name: &'life1 str, dry_run: bool, ) -> Pin<Box<dyn Future<Output = Result<(), WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Workspace<P, H>: 'async_trait,

Publish a single crate and every other workspace crate it directly or transitively depends on.
Crates are published in reverse topological order to match the existing try_publish behaviour.
Source§

impl<H> UpdateReadmeFiles for Workspace<PathBuf, H>

Source§

type Error = AiReadmeWriterError

Source§

fn update_readme_files<'life0, 'async_trait>( workspace_arc: Arc<Mutex<Workspace<PathBuf, H>>>, plant: bool, force: bool, config: &'life0 ReadmeWriterConfig, ) -> Pin<Box<dyn Future<Output = Result<(), <Workspace<PathBuf, H> as UpdateReadmeFiles>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<PathBuf, H>: 'async_trait,

Orchestrates the steps to generate queries, call the AI, and update README(s). The force parameter means: if false, skip crates/workspaces that already have a README. The config carries user preferences (docs/fn-bodies/test-items/etc.) for readme generation.
Source§

impl<P, H> ValidateIntegrity for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

type Error = WorkspaceError

Source§

fn validate_integrity<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), <Workspace<P, H> as ValidateIntegrity>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> WatchAndReload for Workspace<P, H>
where P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: WatchAndReload<Error = CrateError> + RebuildOrTest<Error = CrateError> + CrateHandleInterface<P> + Send + Sync,

Source§

type Error = WorkspaceError

Source§

fn watch_and_reload<'a, 'life0, 'async_trait>( &'life0 self, tx: Option<Sender<Result<(), <Workspace<P, H> as WatchAndReload>::Error>>>, runner: Arc<dyn CommandRunner + Send + Sync + 'a>, cancel_token: CancellationToken, ) -> Pin<Box<dyn Future<Output = Result<(), <Workspace<P, H> as WatchAndReload>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

fn is_relevant_change<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 Path, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> WorkspaceDownstreamExt for Workspace<P, H>
where P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: CrateHandleInterface<P> + Bump<Error = CrateError> + Send + Sync,

Source§

fn update_downstreams_recursively<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, dep_name: &'life1 str, new_version: &'life2 Version, visited: &'life3 mut HashSet<String>, ) -> Pin<Box<dyn Future<Output = Result<(), WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Workspace<P, H>: 'async_trait,

Source§

impl<P, H> WorkspaceInterface<P, H> for Workspace<P, H>
where H: CrateHandleInterface<P>, P: for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Clone + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Auto Trait Implementations§

§

impl<P, H> Freeze for Workspace<P, H>
where P: Freeze,

§

impl<P, H> !RefUnwindSafe for Workspace<P, H>

§

impl<P, H> Send for Workspace<P, H>

§

impl<P, H> Sync for Workspace<P, H>

§

impl<P, H> Unpin for Workspace<P, H>
where P: Unpin,

§

impl<P, H> !UnwindSafe for Workspace<P, H>

Blanket Implementations§

Source§

impl<P, H, T> AddNewCrateToWorkspace<P, H> for T
where P: for<'async_trait> Debug + for<'async_trait> Clone + for<'async_trait> From<PathBuf> + for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait, H: CrateHandleInterface<P> + Debug + Send + Sync + Clone, T: ScanPrefixGroups<P, H, Error = WorkspaceError> + RegisterInPrefixGroup<P, H, Error = WorkspaceError> + CreateCrateSkeleton<P> + AddInternalDependency<P, H, Error = WorkspaceError> + AddToWorkspaceMembers<P> + WorkspaceInterface<P, H> + AsRef<Path> + Sync + Send,

Source§

type Error = WorkspaceError

Source§

fn add_new_crate_to_workspace<'life0, 'life1, 'async_trait>( &'life0 mut self, new_crate_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<H, <T as AddNewCrateToWorkspace<P, H>>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Creates the new crate on disk, appends it to the workspace membership, tries to detect a prefix group, and if found, registers it in that group.
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GetFileSize for T
where T: AsRef<Path> + Send + Sync,

Source§

fn file_size<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, FileError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Source§

impl<T> GetVersionOfLocalDep for T
where T: Send + Sync + AsRef<Path>,

Source§

fn version_of_local_dep<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dep_name: &'life1 str, dep_path: &'life2 str, ) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, T: 'async_trait,

Source§

impl<P> HasCargoTomlPathBuf for P
where P: for<'async_trait> AsRef<Path> + for<'async_trait> Send + for<'async_trait> Sync + 'async_trait,

Source§

fn cargo_toml_path_buf<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PathBuf, <P as HasCargoTomlPathBuf>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, P: 'async_trait,

Asynchronously returns the path to the Cargo.toml

Source§

type Error = CrateError

Source§

impl<P> HasCargoTomlPathBufSync for P
where P: AsRef<Path>,

Source§

fn cargo_toml_path_buf_sync( &self, ) -> Result<PathBuf, <P as HasCargoTomlPathBufSync>::Error>

Asynchronously returns the path to the Cargo.toml

Source§

type Error = CrateError

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoBox<dyn Any> for T
where T: Any,

Source§

fn into_box(self) -> Box<dyn Any>

Convert self into the appropriate boxed form.
Source§

impl<T> IntoBox<dyn Any + Send> for T
where T: Any + Send,

Source§

fn into_box(self) -> Box<dyn Any + Send>

Convert self into the appropriate boxed form.
Source§

impl<T> IntoBox<dyn Any + Send + Sync> for T
where T: Any + Send + Sync,

Source§

fn into_box(self) -> Box<dyn Any + Send + Sync>

Convert self into the appropriate boxed form.
Source§

impl<T> IntoCollection<T> for T

Source§

fn into_collection<A>(self) -> SmallVec<A>
where A: Array<Item = T>,

Converts self into a collection.
Source§

fn mapped<U, F, A>(self, f: F) -> SmallVec<A>
where F: FnMut(T) -> U, A: Array<Item = U>,

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Paint for T
where T: ?Sized,

Source§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
Source§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
Source§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
Source§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
Source§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
Source§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
Source§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
Source§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
Source§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
Source§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
Source§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
Source§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
Source§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
Source§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
Source§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
Source§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
Source§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
Source§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
Source§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
Source§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
Source§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
Source§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
Source§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
Source§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
Source§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
Source§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
Source§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
Source§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
Source§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
Source§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
Source§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
Source§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
Source§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
Source§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
Source§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
Source§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
Source§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
Source§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
Source§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
Source§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
Source§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling Attribute value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
Source§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
Source§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
Source§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
Source§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
Source§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
Source§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
Source§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
Source§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi Quirk value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
Source§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
Source§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
Source§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
Source§

fn clear(&self) -> Painted<&T>

👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear(). The clear() method will be removed in a future release.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
Source§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
Source§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
Source§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
Source§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the Condition value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
Source§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new Painted with a default Style. Read more
Source§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<P> RootDirPathBuf for P
where P: AsRef<Path> + Send + Sync,

Source§

fn root_dir_path_buf(&self) -> PathBuf

returns the path to the Cargo.toml

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,