Struct DetailedIncludeConfig
pub struct DetailedIncludeConfig {
pub path: ConfigParentRelativePath,
pub optional: bool,
}Expand description
Represents a config-include value in the configuration.
Fields§
§path: ConfigParentRelativePath§optional: boolWhether this include is optional (missing files are silently ignored)
Implementations§
§impl DetailedIncludeConfig
impl DetailedIncludeConfig
pub fn resolve_path(&self, cwd: &Path) -> Option<PathBuf>
pub fn resolve_path(&self, cwd: &Path) -> Option<PathBuf>
Resolves the absolute path for this include.
For file based include,
it is relative to parent directory of the config file includes it.
For example, if .cargo/config.toml has a include = “foo.toml”, Cargo will load .cargo/foo.toml`.
For CLI based include (e.g., --config 'include = "foo.toml"'),
it is relative to the current working directory.
Returns None if this is an optional include and the file doesn’t exist.
Otherwise returns Some(PathBuf) with the absolute path.
Trait Implementations§
§impl<'de> Deserialize<'de> for DetailedIncludeConfig
impl<'de> Deserialize<'de> for DetailedIncludeConfig
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DetailedIncludeConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DetailedIncludeConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Serialize for DetailedIncludeConfig
impl Serialize for DetailedIncludeConfig
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Forget for DetailedIncludeConfig
impl Freeze for DetailedIncludeConfig
impl Move for DetailedIncludeConfig
impl RefUnwindSafe for DetailedIncludeConfig
impl Send for DetailedIncludeConfig
impl Sync for DetailedIncludeConfig
impl Unpin for DetailedIncludeConfig
impl UnsafeUnpin for DetailedIncludeConfig
impl UnwindSafe for DetailedIncludeConfig
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 64 bytes