pub struct PatternExpansionService { /* private fields */ }Expand description
Service for pattern expansion and resolution.
Handles expansion of glob patterns to concrete dependencies and maintains mappings between concrete files and their source patterns.
Implementations§
Source§impl PatternExpansionService
impl PatternExpansionService
Sourcepub async fn expand_pattern(
&self,
core: &ResolutionCore,
dep: &ResourceDependency,
resource_type: ResourceType,
prepared_versions: &DashMap<String, PreparedSourceVersion>,
) -> Result<Vec<(String, ResourceDependency)>>
pub async fn expand_pattern( &self, core: &ResolutionCore, dep: &ResourceDependency, resource_type: ResourceType, prepared_versions: &DashMap<String, PreparedSourceVersion>, ) -> Result<Vec<(String, ResourceDependency)>>
Expand a pattern dependency to concrete dependencies.
Takes a glob pattern like “agents/*.md” and expands it to concrete file paths like [“agents/foo.md”, “agents/bar.md”].
§Arguments
core- The resolution core with cache and source managerdep- The pattern dependency to expandresource_type- The type of resource being expanded
§Returns
List of (name, concrete_dependency) tuples
Sourcepub fn get_pattern_alias(
&self,
resource_type: ResourceType,
name: &str,
) -> Option<Ref<'_, (ResourceType, String), String>>
pub fn get_pattern_alias( &self, resource_type: ResourceType, name: &str, ) -> Option<Ref<'_, (ResourceType, String), String>>
Sourcepub fn add_pattern_alias(
&self,
resource_type: ResourceType,
concrete_name: String,
pattern_name: String,
)
pub fn add_pattern_alias( &self, resource_type: ResourceType, concrete_name: String, pattern_name: String, )
Record a pattern alias mapping.
§Arguments
resource_type- The resource typeconcrete_name- The concrete file namepattern_name- The pattern that expanded to this file
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PatternExpansionService
impl !RefUnwindSafe for PatternExpansionService
impl Send for PatternExpansionService
impl Sync for PatternExpansionService
impl Unpin for PatternExpansionService
impl !UnwindSafe for PatternExpansionService
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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