pub struct ResourceConfig {
pub path: Option<String>,
pub merge_target: Option<String>,
pub flatten: Option<bool>,
}Expand description
Resource configuration within a tool.
Defines the installation path for a specific resource type within a tool. Resources can either:
- Install to a subdirectory (via
path) - Merge into a configuration file (via
merge_target)
At least one of path or merge_target should be set for a resource type
to be considered supported by a tool.
Fields§
§path: Option<String>Subdirectory path for this resource type relative to the tool’s base directory.
Used for resources that install as separate files (agents, snippets, commands, scripts). When None, this resource type either uses merge_target or is not supported.
merge_target: Option<String>Target configuration file for merging this resource type.
Used for resources that merge into configuration files (hooks, MCP servers). The path is relative to the project root.
§Examples
- Hooks:
.claude/settings.local.json - MCP servers:
.mcp.jsonor.opencode/opencode.json
flatten: Option<bool>Default flatten behavior for this resource type.
When true: Only the filename is used for installation (e.g., nested/dir/file.md → file.md)
When false: Full relative path is preserved (e.g., nested/dir/file.md → nested/dir/file.md)
This default can be overridden per-dependency using the flatten field.
If not specified, defaults to false (preserve directory structure).
Trait Implementations§
Source§impl Clone for ResourceConfig
impl Clone for ResourceConfig
Source§fn clone(&self) -> ResourceConfig
fn clone(&self) -> ResourceConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResourceConfig
impl Debug for ResourceConfig
Source§impl<'de> Deserialize<'de> for ResourceConfig
impl<'de> Deserialize<'de> for ResourceConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ResourceConfig
impl PartialEq for ResourceConfig
Source§impl Serialize for ResourceConfig
impl Serialize for ResourceConfig
impl Eq for ResourceConfig
impl StructuralPartialEq for ResourceConfig
Auto Trait Implementations§
impl Freeze for ResourceConfig
impl RefUnwindSafe for ResourceConfig
impl Send for ResourceConfig
impl Sync for ResourceConfig
impl Unpin for ResourceConfig
impl UnwindSafe for ResourceConfig
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
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§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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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