pub type CheckRoundTripEncoding = Any<CheckRoundTripEncoding>;
Available on crate feature
attributes
only.Expand description
The core.checkRoundTripEncoding
key.
Aliased Type§
struct CheckRoundTripEncoding {
pub name: &'static str,
pub section: &'static dyn Section,
pub subsection_requirement: Option<SubSectionRequirement>,
pub link: Option<Link>,
pub note: Option<Note>,
/* private fields */
}
Fields§
§name: &'static str
The key of the value in the git configuration.
section: &'static dyn Section
The parent section of the key.
subsection_requirement: Option<SubSectionRequirement>
The subsection requirement to use.
link: Option<Link>
A link to other resources that might be eligible as value.
note: Option<Note>
A note about this key.
Implementations§
source§impl<T: Validate> Any<T>
impl<T: Validate> Any<T>
Init other validate implementations
sourcepub const fn new_with_validate(
name: &'static str,
section: &'static dyn Section,
validate: T
) -> Self
pub const fn new_with_validate( name: &'static str, section: &'static dyn Section, validate: T ) -> Self
Create a new instance from name
and section
source§impl<T: Validate> Any<T>
impl<T: Validate> Any<T>
Builder
sourcepub const fn with_subsection_requirement(
self,
requirement: Option<SubSectionRequirement>
) -> Self
pub const fn with_subsection_requirement( self, requirement: Option<SubSectionRequirement> ) -> Self
Set the subsection requirement to non-default values.
sourcepub const fn with_environment_override(self, var: &'static str) -> Self
pub const fn with_environment_override(self, var: &'static str) -> Self
Associate an environment variable with this key.
This is mainly useful for enriching error messages.
sourcepub const fn with_fallback(self, key: &'static dyn Key) -> Self
pub const fn with_fallback(self, key: &'static dyn Key) -> Self
Set a link to another key which serves as fallback to provide a value if this key is not set.
sourcepub const fn with_note(self, message: &'static str) -> Self
pub const fn with_note(self, message: &'static str) -> Self
Attach an informative message to this key.
sourcepub const fn with_deviation(self, message: &'static str) -> Self
pub const fn with_deviation(self, message: &'static str) -> Self
Inform about a deviation in how this key is interpreted.
Trait Implementations§
source§impl<T: Validate> Key for Any<T>
impl<T: Validate> Key for Any<T>
source§fn validate(&self, value: &BStr) -> Result<(), Error>
fn validate(&self, value: &BStr) -> Result<(), Error>
See if
value
is allowed as value of this key, or return a descriptive error if it is not.source§fn section(&self) -> &dyn Section
fn section(&self) -> &dyn Section
The section containing this key. Git configuration has no free-standing keys, they are always underneath a section.
source§fn subsection_requirement(&self) -> Option<&SubSectionRequirement>
fn subsection_requirement(&self) -> Option<&SubSectionRequirement>
The return value encodes three possible states to indicate subsection requirements Read more
source§fn environment_override(&self) -> Option<&str>
fn environment_override(&self) -> Option<&str>
Return the name of an environment variable that would override this value (after following links until one is found).
source§fn the_environment_override(&self) -> &str
fn the_environment_override(&self) -> &str
Return the environment override that must be set on this key. Read more
source§fn logical_name(&self) -> String
fn logical_name(&self) -> String
Produce a name that describes how the name is composed. This is
core.bare
for statically known keys, or branch.<name>.key
for complex ones.source§fn full_name(&self, subsection: Option<&BStr>) -> Result<BString, String>
fn full_name(&self, subsection: Option<&BStr>) -> Result<BString, String>
The full name of the key for use in configuration overrides, like
core.bare
, or remote.<subsection>.url
if subsection
is
not None
.
May fail if this key needs a subsection, or may not have a subsection.source§fn validated_assignment(&self, value: &BStr) -> Result<BString, Error>
fn validated_assignment(&self, value: &BStr) -> Result<BString, Error>
Return an assignment with the keys full name to
value
, suitable for configuration overrides.
Note that this will fail if the key requires a subsection name.source§fn validated_assignment_fmt(
&self,
value: &dyn Display
) -> Result<BString, Error>
fn validated_assignment_fmt( &self, value: &dyn Display ) -> Result<BString, Error>
Return an assignment with the keys full name to
value
, suitable for configuration overrides.
Note that this will fail if the key requires a subsection name.source§fn validated_assignment_with_subsection(
&self,
value: &BStr,
subsection: &BStr
) -> Result<BString, Error>
fn validated_assignment_with_subsection( &self, value: &BStr, subsection: &BStr ) -> Result<BString, Error>
Return an assignment to
value
with the keys full name within subsection
, suitable for configuration overrides.
Note that this is only valid if this key supports parameterized sub-sections, or else an error is returned.