pub enum DebugInfo {
Resolved(TomlDebugInfo),
Deferred(TomlDebugInfo),
}
Expand description
The debuginfo level setting.
This is semantically a TomlDebugInfo
, and should be used as so via the
DebugInfo::into_inner
method for all intents and purposes.
Internally, it’s used to model a debuginfo level whose value can be deferred for optimization purposes: host dependencies usually don’t need the same level as target dependencies. For dependencies that are shared between the two however, that value also affects reuse: different debuginfo levels would cause to build a unit twice. By deferring the choice until we know whether to choose the optimized value or the default value, we can make sure the unit is only built once and the unit graph is still optimized.
Variants§
Resolved(TomlDebugInfo)
A debuginfo level that is fixed and will not change.
This can be set by a profile, user, or default value.
Deferred(TomlDebugInfo)
For internal purposes: a deferred debuginfo level that can be optimized away, but has this value otherwise.
Behaves like Resolved
in all situations except for the default build
dependencies profile: whenever a build dependency is not shared with
runtime dependencies, this level is weakened to a lower level that is
faster to build (see DebugInfo::weaken
).
In all other situations, this level value will be the one to use.
Implementations§
source§impl DebugInfo
impl DebugInfo
sourcepub fn into_inner(self) -> TomlDebugInfo
pub fn into_inner(self) -> TomlDebugInfo
The main way to interact with this debuginfo level, turning it into a TomlDebugInfo
.
sourcepub(crate) fn is_turned_on(&self) -> bool
pub(crate) fn is_turned_on(&self) -> bool
Returns true if any debuginfo will be generated. Helper
for a common operation on the usual Option
representation.
pub(crate) fn is_deferred(&self) -> bool
Trait Implementations§
source§impl Ord for DebugInfo
impl Ord for DebugInfo
source§impl PartialEq<DebugInfo> for DebugInfo
impl PartialEq<DebugInfo> for DebugInfo
source§impl PartialOrd<DebugInfo> for DebugInfo
impl PartialOrd<DebugInfo> for DebugInfo
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for DebugInfo
impl Eq for DebugInfo
Auto Trait Implementations§
impl RefUnwindSafe for DebugInfo
impl Send for DebugInfo
impl Sync for DebugInfo
impl Unpin for DebugInfo
impl UnwindSafe for DebugInfo
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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> Serialize for Twhere
T: Serialize + ?Sized,
impl<T> Serialize for Twhere T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§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>,
source§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: 2 bytes
Size for each variant:
Resolved
: 1 byteDeferred
: 1 byte