pub struct DestructiveVerb {
pub wire: &'static str,
pub target_flag: &'static str,
pub waiver_flag: &'static str,
pub effect: DestructiveEffect,
pub schema_stem: &'static str,
}Expand description
One verb that destroys, with everything needed to refuse it safely.
Fields§
§wire: &'static strInvocation in wire spelling, as the refusal message names it.
target_flag: &'static strFlag that designates the target in argv.
waiver_flag: &'static strFlag that accepts an ambient target on purpose.
effect: DestructiveEffectWhat would happen to the target.
schema_stem: &'static strSchema stem under docs/schemas/, which must carry target_source.
Implementations§
Source§impl DestructiveVerb
impl DestructiveVerb
Sourcepub fn must_refuse(self, waived: bool, source: PathSource) -> bool
pub fn must_refuse(self, waived: bool, source: PathSource) -> bool
Whether this invocation must be refused for want of a designated target.
Only PathSource::CliFlag counts as designation. Xdg is the ambient
layer the caller never named, and Unresolved is worse: there is no
target at all, so acting would be acting somewhere unknown.
Sourcepub fn refuse(self, target: String) -> ErrorDetail
pub fn refuse(self, target: String) -> ErrorDetail
The refusal, naming the victim and both ways out of it.
The message names the target because a refusal that hides which path was about to be destroyed teaches the caller nothing about what to pass.
Trait Implementations§
Source§impl Clone for DestructiveVerb
impl Clone for DestructiveVerb
impl Copy for DestructiveVerb
Source§impl Debug for DestructiveVerb
impl Debug for DestructiveVerb
impl Eq for DestructiveVerb
Source§impl PartialEq for DestructiveVerb
impl PartialEq for DestructiveVerb
impl StructuralPartialEq for DestructiveVerb
Auto Trait Implementations§
impl Freeze for DestructiveVerb
impl RefUnwindSafe for DestructiveVerb
impl Send for DestructiveVerb
impl Sync for DestructiveVerb
impl Unpin for DestructiveVerb
impl UnsafeUnpin for DestructiveVerb
impl UnwindSafe for DestructiveVerb
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.