pub struct UnitFor { /* private fields */ }Expand description
Flags used in creating Units to indicate the purpose for the target, and
to ensure the target’s dependencies have the correct settings.
Implementations§
Source§impl UnitFor
impl UnitFor
Sourcepub fn new_normal() -> UnitFor
pub fn new_normal() -> UnitFor
A unit for a normal target/dependency (i.e. not custom build, proc-macro/plugin, or test/bench).
Sourcepub fn new_compiler() -> UnitFor
pub fn new_compiler() -> UnitFor
A unit for a proc-macro or compiler plugin or their dependencies.
Sourcepub fn with_for_host(self, for_host: bool) -> UnitFor
pub fn with_for_host(self, for_host: bool) -> UnitFor
Create a variant based on for_host setting.
When for_host is true, this clears panic_ok in a sticky fashion so
that all its dependencies also have panic_ok=false.
Sourcepub fn is_custom_build(self) -> bool
pub fn is_custom_build(self) -> bool
Returns true if this unit is for a custom build script or one of its dependencies.
Sourcepub fn is_panic_ok(self) -> bool
pub fn is_panic_ok(self) -> bool
Returns true if this unit is allowed to set the panic compiler flag.
Sourcepub fn all_values() -> &'static [UnitFor]
pub fn all_values() -> &'static [UnitFor]
All possible values, used by clean.
Trait Implementations§
impl Copy for UnitFor
impl Eq for UnitFor
impl StructuralPartialEq for UnitFor
Auto Trait Implementations§
impl Freeze for UnitFor
impl RefUnwindSafe for UnitFor
impl Send for UnitFor
impl Sync for UnitFor
impl Unpin for UnitFor
impl UnsafeUnpin for UnitFor
impl UnwindSafe for UnitFor
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