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
native hook 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 any other placement.
Sourcepub fn keyed_path(&self) -> Option<&'static str>
pub fn keyed_path(&self) -> Option<&'static str>
The project-relative file whose entries are keyed by hook name; None for any other
placement.
Sourcepub fn native_hook_problem(&self, content: &str) -> Option<&'static str>
pub fn native_hook_problem(&self, content: &str) -> Option<&'static str>
What is wrong with a file target’s native hook, if anything. Warning-only: a file native hook 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 installs_files(&self) -> bool
pub fn installs_files(&self) -> bool
Whether a hook can own files on the target besides its directory copy: the files of a file target, or a keyed target’s runner data.
Sourcepub fn native_hook_path(&self, hook_name: &str) -> Option<String>
pub fn native_hook_path(&self, hook_name: &str) -> Option<String>
The path, relative to the target root, of the hook’s own native hook 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 Forget for Target
impl Freeze for Target
impl Move 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
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.