pub struct Target {
pub root: &'static str,
pub placement: Placement,
pub profile: Profile,
pub other_events: &'static [&'static str],
}Expand description
One target root’s hook rules.
Fields§
§root: &'static str§placement: Placement§profile: Profile§other_events: &'static [&'static str]Events the harness reads that profile.events has no row for: they travel only in a
fragment marked unchecked.
Implementations§
Source§impl Target
impl Target
Sourcepub fn reads(&self, event: &str) -> bool
pub fn reads(&self, event: &str) -> bool
Whether the harness reads event from its hook file; it ignores any other key.
Sourcepub fn merge_file(&self) -> Option<&MergeFile>
pub fn merge_file(&self) -> Option<&MergeFile>
The file a merge target appends entries to; None for a file target.
Sourcepub fn fragment_problem(&self, content: &str) -> Option<&'static str>
pub fn fragment_problem(&self, content: &str) -> Option<&'static str>
What is wrong with a file target’s fragment, if anything. Warning-only: a file fragment is otherwise opaque, and the caller words the diagnostic.
Sourcepub fn is_file(&self) -> bool
pub fn is_file(&self) -> bool
Whether the target installs whole files rather than merging entries.
Sourcepub fn fragment_path(&self, hook_name: &str) -> Option<String>
pub fn fragment_path(&self, hook_name: &str) -> Option<String>
The path, relative to the target root, of the hook’s own fragment file; None for a
merge target, which has no per-hook file.
Sourcepub fn generated_path(&self, hook_name: &str) -> Option<String>
pub fn generated_path(&self, hook_name: &str) -> Option<String>
The path, relative to the target root, of the file generated from the hook’s
[hooks]; None for a merge target.
Trait Implementations§
impl Copy for Target
impl Eq for Target
impl StructuralPartialEq for Target
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnsafeUnpin for Target
impl UnwindSafe for Target
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
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
Compare self to
key and return true if they are equal.